Package org.springframework.security.config.annotation.authentication.builders

Examples of org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder


    private ObjectPostProcessor<Object> objectPostProcessor;

    @Bean
    public AuthenticationManagerBuilder authenticationManagerBuilder(ObjectPostProcessor<Object> objectPostProcessor) {
        return new AuthenticationManagerBuilder(objectPostProcessor);
    }
View Full Code Here


    public AuthenticationManager getAuthenticationManager() throws Exception {
        if(authenticationManagerInitialized) {
            return authenticationManager;
        }

        AuthenticationManagerBuilder authBuilder = authenticationManagerBuilder(objectPostProcessor);
        for(GlobalAuthenticationConfigurerAdapter config : globalAuthConfigures) {
            authBuilder.apply(config);
        }

        authenticationManager = authBuilder.build();

        if(authenticationManager == null) {
            authenticationManager = getAuthenticationMangerBean();
        }
View Full Code Here

     * @return
     * @throws Exception
     * @see {@link #userDetailsService()}
     */
    public UserDetailsService userDetailsServiceBean() throws Exception {
        AuthenticationManagerBuilder globalAuthBuilder = context.getBean(AuthenticationManagerBuilder.class);
        return new UserDetailsServiceDelegator(Arrays.asList(localConfigureAuthenticationBldr, globalAuthBuilder));
    }
View Full Code Here

     * changing the instance of {@link #userDetailsServiceBean()}.
     *
     * @return
     */
    protected UserDetailsService userDetailsService() {
        AuthenticationManagerBuilder globalAuthBuilder = context.getBean(AuthenticationManagerBuilder.class);
        return new UserDetailsServiceDelegator(Arrays.asList(localConfigureAuthenticationBldr, globalAuthBuilder));
    }
View Full Code Here

    @Autowired
    public void setObjectPostProcessor(ObjectPostProcessor<Object> objectPostProcessor) {
        this.objectPostProcessor = objectPostProcessor;

        authenticationBuilder = new AuthenticationManagerBuilder(objectPostProcessor);
        localConfigureAuthenticationBldr = new AuthenticationManagerBuilder(objectPostProcessor) {
            @Override
            public AuthenticationManagerBuilder eraseCredentials(boolean eraseCredentials) {
                authenticationBuilder.eraseCredentials(eraseCredentials);
                return super.eraseCredentials(eraseCredentials);
            }
View Full Code Here

     * @return
     */
    protected AuthenticationManager authenticationManager() throws Exception {
        if(authenticationManager == null) {
            DefaultAuthenticationEventPublisher eventPublisher = objectPostProcessor.postProcess(new DefaultAuthenticationEventPublisher());
            auth = new AuthenticationManagerBuilder(objectPostProcessor);
            auth.authenticationEventPublisher(eventPublisher);
            configure(auth);
            if(disableAuthenticationRegistry) {
                authenticationManager = getAuthenticationConfiguration().getAuthenticationManager();
            } else {
View Full Code Here

      if (user.isDefaultPassword()) {
        logger.info("\n\nUsing default security password: " + user.getPassword()
            + "\n\n");
      }

      this.defaultAuth = new AuthenticationManagerBuilder(
          AuthenticationManagerConfiguration.this.objectPostProcessor);

      Set<String> roles = new LinkedHashSet<String>(user.getRole());

      this.parent = this.defaultAuth.inMemoryAuthentication()
View Full Code Here

@Configuration
@EnableWebSecurity
public class SecurityConfiguration extends WebSecurityConfigurerAdapter {
    @Bean(name = {"authManager",BeanIds.AUTHENTICATION_MANAGER})
    public AuthenticationManager authManager() throws Exception {
        return new AuthenticationManagerBuilder()
            .inMemoryAuthentication()
                .withUser("marissa").password("koala").roles("USER").and()
                .withUser("paul").password("emu").roles("USER").and()
                .and()
            .build();
View Full Code Here

TOP

Related Classes of org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.