Search in sources :

Example 1 with AbstractRememberMeServices

use of org.springframework.security.web.authentication.rememberme.AbstractRememberMeServices in project spring-security by spring-projects.

the class RememberMeConfigurer method getRememberMeServices.

/**
	 * Gets the {@link RememberMeServices} or creates the {@link RememberMeServices}.
	 * @param http the {@link HttpSecurity} to lookup shared objects
	 * @param key the {@link #key(String)}
	 * @return the {@link RememberMeServices} to use
	 * @throws Exception
	 */
private RememberMeServices getRememberMeServices(H http, String key) throws Exception {
    if (this.rememberMeServices != null) {
        if (this.rememberMeServices instanceof LogoutHandler && this.logoutHandler == null) {
            this.logoutHandler = (LogoutHandler) this.rememberMeServices;
        }
        return this.rememberMeServices;
    }
    AbstractRememberMeServices tokenRememberMeServices = createRememberMeServices(http, key);
    tokenRememberMeServices.setParameter(this.rememberMeParameter);
    tokenRememberMeServices.setCookieName(this.rememberMeCookieName);
    if (this.rememberMeCookieDomain != null) {
        tokenRememberMeServices.setCookieDomain(this.rememberMeCookieDomain);
    }
    if (this.tokenValiditySeconds != null) {
        tokenRememberMeServices.setTokenValiditySeconds(this.tokenValiditySeconds);
    }
    if (this.useSecureCookie != null) {
        tokenRememberMeServices.setUseSecureCookie(this.useSecureCookie);
    }
    if (this.alwaysRemember != null) {
        tokenRememberMeServices.setAlwaysRemember(this.alwaysRemember);
    }
    tokenRememberMeServices.afterPropertiesSet();
    this.logoutHandler = tokenRememberMeServices;
    this.rememberMeServices = tokenRememberMeServices;
    return tokenRememberMeServices;
}
Also used : LogoutHandler(org.springframework.security.web.authentication.logout.LogoutHandler) AbstractRememberMeServices(org.springframework.security.web.authentication.rememberme.AbstractRememberMeServices)

Aggregations

LogoutHandler (org.springframework.security.web.authentication.logout.LogoutHandler)1 AbstractRememberMeServices (org.springframework.security.web.authentication.rememberme.AbstractRememberMeServices)1