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:com.launchkey.example.springmvc.SecurityConfig.java

@Autowired
public void configureGlobal(AuthenticationManagerBuilder auth, AuthManager authManager,
        LogoutSuccessHandler logoutSuccessHandler) throws Exception {
    this.logoutSuccessHandler = logoutSuccessHandler;
    auth.authenticationProvider(new LaunchKeyAuthenticationProvider(authManager));
}

From source file:com.toptal.conf.SecurityConfiguration.java

@Override
public final void configure(final AuthenticationManagerBuilder auth) throws Exception {
    auth.userDetailsService(this.userDetails());
    auth.authenticationProvider(this.authenticationProvider());
}

From source file:it.reply.orchestrator.config.security.WebSecurityConfig.java

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

From source file:architecture.user.spring.config.SecurityConfig.java

@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {

    auth.authenticationProvider(authenticationProviderBean());
}

From source file:com.himanshu.poc.h2.springboot.SecurityConfigurer.java

@Override
public void configure(AuthenticationManagerBuilder auth) throws Exception {
    /*auth.inMemoryAuthentication().withUser("admin").password("admin")
    .roles("ADMIN", "USER").and().withUser("user").password("user")
    .roles("USER");*//*from  ww  w  .jav a  2  s . c o m*/
    auth.authenticationProvider(authenticationProviderImpl);
}

From source file:com.frequentis.maritime.mcsr.config.SecurityConfiguration.java

@Inject
public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
    auth.authenticationProvider(keycloakAuthenticationProvider()).userDetailsService(userDetailsService)
            .passwordEncoder(passwordEncoder());
    ;/*from   w w  w  . jav  a2 s  .co m*/
}

From source file:com.esquema.seguridad.ApplicationSecurity.java

@Override
protected void configure(AuthenticationManagerBuilder builder) throws Exception {

    /*/*from w ww  .  j ava2  s .  co m*/
    builder.inMemoryAuthentication().withUser("user").password("user").roles("USER").and().withUser("admin")
    .password("admin").roles("ADMIN");
    */

    builder.authenticationProvider(authProvider);

}

From source file:eu.supersede.fe.security.SecurityConfiguration.java

@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
    // auth.userDetailsService(dbUserDetailsService()).passwordEncoder(bcryptEncoder);
    auth.authenticationProvider(customAuthenticationProvider());
}

From source file:com.muk.spring.config.SpringSecurityConfig.java

@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
    // Don't clear credentials from the authorization.  This is our oauth access token
    auth.eraseCredentials(false);//from w  ww .ja v  a2  s . c  om

    // Add custom provider for a bearer token
    auth.authenticationProvider(bearerTokenAuthenticationProvider());

    // In memory users for basic auth
    final InMemoryUserDetailsManagerConfigurer<AuthenticationManagerBuilder> authBuilder = auth
            .inMemoryAuthentication();
    String decodedPrincipal = null;
    String[] principalParts = null;

    for (final String creds : environment.getProperty("app.principals").split(",")) {
        decodedPrincipal = new String(Base64.decodeBase64(creds));
        principalParts = decodedPrincipal.split(":");

        authBuilder.withUser(principalParts[0]).password(principalParts[1]).roles("USER");
    }
}

From source file:cn.cuizuoli.gotour.config.SecurityConfig.java

@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
    DaoAuthenticationProvider authenticationProvider = new DaoAuthenticationProvider();
    authenticationProvider.setUserDetailsService(userDetailsService());
    authenticationProvider.setPasswordEncoder(NoOpPasswordEncoder.getInstance());
    auth.authenticationProvider(authenticationProvider);
}