Search in sources :

Example 1 with GlobalAuthenticationConfigurerAdapter

use of org.springframework.security.config.annotation.authentication.configurers.GlobalAuthenticationConfigurerAdapter in project spring-security by spring-projects.

the class AuthenticationConfiguration method getAuthenticationManager.

public AuthenticationManager getAuthenticationManager() throws Exception {
    if (this.authenticationManagerInitialized) {
        return this.authenticationManager;
    }
    AuthenticationManagerBuilder authBuilder = authenticationManagerBuilder(this.objectPostProcessor);
    if (this.buildingAuthenticationManager.getAndSet(true)) {
        return new AuthenticationManagerDelegator(authBuilder);
    }
    for (GlobalAuthenticationConfigurerAdapter config : globalAuthConfigurers) {
        authBuilder.apply(config);
    }
    authenticationManager = authBuilder.build();
    if (authenticationManager == null) {
        authenticationManager = getAuthenticationManagerBean();
    }
    this.authenticationManagerInitialized = true;
    return authenticationManager;
}
Also used : GlobalAuthenticationConfigurerAdapter(org.springframework.security.config.annotation.authentication.configurers.GlobalAuthenticationConfigurerAdapter) AuthenticationManagerBuilder(org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder)

Aggregations

AuthenticationManagerBuilder (org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder)1 GlobalAuthenticationConfigurerAdapter (org.springframework.security.config.annotation.authentication.configurers.GlobalAuthenticationConfigurerAdapter)1