Search in sources :

Example 1 with RememberMeServices

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

the class HttpBasicConfigurer method configure.

@Override
public void configure(B http) throws Exception {
    AuthenticationManager authenticationManager = http.getSharedObject(AuthenticationManager.class);
    BasicAuthenticationFilter basicAuthenticationFilter = new BasicAuthenticationFilter(authenticationManager, this.authenticationEntryPoint);
    if (this.authenticationDetailsSource != null) {
        basicAuthenticationFilter.setAuthenticationDetailsSource(this.authenticationDetailsSource);
    }
    RememberMeServices rememberMeServices = http.getSharedObject(RememberMeServices.class);
    if (rememberMeServices != null) {
        basicAuthenticationFilter.setRememberMeServices(rememberMeServices);
    }
    basicAuthenticationFilter = postProcess(basicAuthenticationFilter);
    http.addFilter(basicAuthenticationFilter);
}
Also used : AuthenticationManager(org.springframework.security.authentication.AuthenticationManager) RememberMeServices(org.springframework.security.web.authentication.RememberMeServices) BasicAuthenticationFilter(org.springframework.security.web.authentication.www.BasicAuthenticationFilter)

Example 2 with RememberMeServices

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

the class AbstractAuthenticationFilterConfigurer method configure.

@Override
public void configure(B http) throws Exception {
    PortMapper portMapper = http.getSharedObject(PortMapper.class);
    if (portMapper != null) {
        authenticationEntryPoint.setPortMapper(portMapper);
    }
    authFilter.setAuthenticationManager(http.getSharedObject(AuthenticationManager.class));
    authFilter.setAuthenticationSuccessHandler(successHandler);
    authFilter.setAuthenticationFailureHandler(failureHandler);
    if (authenticationDetailsSource != null) {
        authFilter.setAuthenticationDetailsSource(authenticationDetailsSource);
    }
    SessionAuthenticationStrategy sessionAuthenticationStrategy = http.getSharedObject(SessionAuthenticationStrategy.class);
    if (sessionAuthenticationStrategy != null) {
        authFilter.setSessionAuthenticationStrategy(sessionAuthenticationStrategy);
    }
    RememberMeServices rememberMeServices = http.getSharedObject(RememberMeServices.class);
    if (rememberMeServices != null) {
        authFilter.setRememberMeServices(rememberMeServices);
    }
    F filter = postProcess(authFilter);
    http.addFilter(filter);
}
Also used : AuthenticationManager(org.springframework.security.authentication.AuthenticationManager) SessionAuthenticationStrategy(org.springframework.security.web.authentication.session.SessionAuthenticationStrategy) RememberMeServices(org.springframework.security.web.authentication.RememberMeServices) PortMapper(org.springframework.security.web.PortMapper)

Example 3 with RememberMeServices

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

the class RememberMeConfigurer method init.

@SuppressWarnings("unchecked")
@Override
public void init(H http) throws Exception {
    validateInput();
    String key = getKey();
    RememberMeServices rememberMeServices = getRememberMeServices(http, key);
    http.setSharedObject(RememberMeServices.class, rememberMeServices);
    LogoutConfigurer<H> logoutConfigurer = http.getConfigurer(LogoutConfigurer.class);
    if (logoutConfigurer != null && this.logoutHandler != null) {
        logoutConfigurer.addLogoutHandler(this.logoutHandler);
    }
    RememberMeAuthenticationProvider authenticationProvider = new RememberMeAuthenticationProvider(key);
    authenticationProvider = postProcess(authenticationProvider);
    http.authenticationProvider(authenticationProvider);
    initDefaultLoginFilter(http);
}
Also used : PersistentTokenBasedRememberMeServices(org.springframework.security.web.authentication.rememberme.PersistentTokenBasedRememberMeServices) RememberMeServices(org.springframework.security.web.authentication.RememberMeServices) AbstractRememberMeServices(org.springframework.security.web.authentication.rememberme.AbstractRememberMeServices) TokenBasedRememberMeServices(org.springframework.security.web.authentication.rememberme.TokenBasedRememberMeServices) RememberMeAuthenticationProvider(org.springframework.security.authentication.RememberMeAuthenticationProvider)

Aggregations

RememberMeServices (org.springframework.security.web.authentication.RememberMeServices)3 AuthenticationManager (org.springframework.security.authentication.AuthenticationManager)2 RememberMeAuthenticationProvider (org.springframework.security.authentication.RememberMeAuthenticationProvider)1 PortMapper (org.springframework.security.web.PortMapper)1 AbstractRememberMeServices (org.springframework.security.web.authentication.rememberme.AbstractRememberMeServices)1 PersistentTokenBasedRememberMeServices (org.springframework.security.web.authentication.rememberme.PersistentTokenBasedRememberMeServices)1 TokenBasedRememberMeServices (org.springframework.security.web.authentication.rememberme.TokenBasedRememberMeServices)1 SessionAuthenticationStrategy (org.springframework.security.web.authentication.session.SessionAuthenticationStrategy)1 BasicAuthenticationFilter (org.springframework.security.web.authentication.www.BasicAuthenticationFilter)1