protected void configure()

in src/main/java/org/apache/sling/auth/xing/login/impl/XingLoginAuthenticationHandler.java [134:168]


    protected void configure(final ComponentContext context) {
        final Dictionary properties = context.getProperties();
        consumerKey = PropertiesUtil.toString(properties.get(CONSUMER_KEY_PARAMETER), "").trim();
        userCookie = PropertiesUtil.toString(properties.get(USER_COOKIE_PARAMETER), DEFAULT_USER_COOKIE).trim();
        userIdCookie = PropertiesUtil.toString(properties.get(USERID_COOKIE_PARAMETER), DEFAULT_USERID_COOKIE).trim();
        maxCookieSize = PropertiesUtil.toInteger(properties.get(MAX_COOKIE_SIZE_PARAMETER), DEFAULT_MAX_COOKIE_SIZE);
        loginPath = PropertiesUtil.toString(properties.get(LOGIN_PATH_PARAMETER), "").trim();
        logoutPath = PropertiesUtil.toString(properties.get(LOGOUT_PATH_PARAMETER), "").trim();

        if (StringUtils.isEmpty(consumerKey)) {
            logger.warn("configured consumer key is empty");
            xingCookie = "";
        } else {
            xingCookie = XingLogin.XING_COOKIE_PREFIX.concat(consumerKey);
        }

        if (loginPageRegistration != null) {
            loginPageRegistration.unregister();
        }

        if (StringUtils.isEmpty(loginPath)) {
            logger.warn("configured login path is empty");
        } else {
            final Dictionary<String, Object> loginPathProperties = new Hashtable<String, Object>();
            final String[] authRequirements = new String[]{"-".concat(loginPath)};
            loginPathProperties.put(AuthConstants.AUTH_REQUIREMENTS, authRequirements);
            loginPageRegistration = context.getBundleContext().registerService(Object.class.getName(), new Object(), loginPathProperties);
        }

        if (StringUtils.isEmpty(logoutPath)) {
            logger.warn("configured logout path is empty");
        }

        logger.info("configured with consumer key '{}', cookie name '{}', login path '{}' and logout path '{}'", consumerKey, xingCookie, loginPath, logoutPath);
    }