Example usage for org.springframework.security.config.annotation.authentication.builders AuthenticationManagerBuilder authenticationProvider

List of usage examples for org.springframework.security.config.annotation.authentication.builders AuthenticationManagerBuilder authenticationProvider

Introduction

In this page you can find the example usage for org.springframework.security.config.annotation.authentication.builders AuthenticationManagerBuilder authenticationProvider.

Prototype

public AuthenticationManagerBuilder authenticationProvider(AuthenticationProvider authenticationProvider) 

Source Link

Document

Add authentication based upon the custom AuthenticationProvider that is passed in.

Usage

From source file:org.verinice.rest.security.AuthenticationConfiguration.java

@Override
public void init(AuthenticationManagerBuilder auth) throws Exception {
    auth.userDetailsService(userDetailService);
    auth.authenticationProvider(new VeriniceAuthenticationProvider(userDetailService, environment));
    auth.authenticationEventPublisher(new DefaultAuthenticationEventPublisher());
}

From source file:io.syndesis.runtime.KeycloakConfiguration.java

@Autowired
public void configureGlobal(AuthenticationManagerBuilder auth) {
    auth.authenticationProvider(keycloakAuthenticationProvider());
}

From source file:de.metas.ui.web.config.SecurityConfig.java

@Override
protected void configure(final AuthenticationManagerBuilder auth) throws Exception {
    auth.authenticationProvider(authenticationProvider());
}

From source file:br.com.joaops.smt.configuration.SecurityConfig.java

@Override
protected void configure(AuthenticationManagerBuilder auth) {
    auth.eraseCredentials(true);
    auth.authenticationProvider(authenticatorProvider);
}

From source file:ch.javaee.basicMvc.config.SecurityConfig.java

/**
 * For our sample we use a simple user/password credential
 *
 * @param auth//from  ww  w.j a  v  a2 s  .  c om
 * @throws Exception
 */
@Autowired
public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
    auth.authenticationProvider(authenticationProvider());

}

From source file:com.devicehive.application.security.WebSecurityConfig.java

@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
    auth.authenticationProvider(basicAuthenticationProvider())
            .authenticationProvider(jwtTokenAuthenticationProvider())
            .authenticationProvider(anonymousAuthenticationProvider());
}

From source file:io.github.proxyprint.kitchen.config.WebSecurityConfig.java

@Autowired
public void configureGlobalSecurity(AuthenticationManagerBuilder auth) throws Exception {
    auth.userDetailsService(userDetailsService);
    auth.authenticationProvider(authenticationProvider());
}

From source file:com.devnexus.ting.config.WebSecurityConfig.java

@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
    auth.authenticationProvider(socialAuthenticationProvider());
    auth.userDetailsService(userDetailsService).passwordEncoder(passwordEncoder);
}

From source file:com.itn.configuration.SecurityConfiguration.java

@Autowired
public void configureGlobalSecurity(AuthenticationManagerBuilder auth) throws Exception {
    auth.userDetailsService(userDetailsService);
    auth.authenticationProvider(authenticationProvider());//This is for password encryption
}

From source file:com.github.lynxdb.server.api.http.WebSecurityConfig.java

@Autowired
public void registerAuthentication(AuthenticationManagerBuilder auth) throws Exception {
    auth.authenticationProvider(new AbstractUserDetailsAuthenticationProvider() {
        @Override/*ww w. j  a v  a 2  s  .c o m*/
        protected void additionalAuthenticationChecks(UserDetails ud, UsernamePasswordAuthenticationToken upat)
                throws AuthenticationException {

        }

        @Override
        protected UserDetails retrieveUser(String string, UsernamePasswordAuthenticationToken upat)
                throws AuthenticationException {
            User user = users.byLogin(string);
            if (user == null) {
                throw new UsernameNotFoundException("No such User : " + string);
            }
            if (user.checkPassword(upat.getCredentials().toString())) {
                return user;
            } else {
                throw new BadCredentialsException("Bad credentials");

            }
        }
    });
}