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

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

Introduction

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

Prototype

public <T extends UserDetailsService> DaoAuthenticationConfigurer<AuthenticationManagerBuilder, T> userDetailsService(
        T userDetailsService) throws Exception 

Source Link

Document

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

Usage

From source file:be.bittich.quote.config.SecurityConfig.java

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

From source file:net.prasenjit.auth.config.SecurityConfig.java

/**
 * {@inheritDoc}//  ww w  .  ja  v a  2s.com
 */
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
    auth.userDetailsService(userService).passwordEncoder(passwordEncoder);
}

From source file:org.jrecruiter.web.config.WebSecurityConfig.java

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

From source file:reconf.server.ApplicationSecurity.java

@Autowired
public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
    auth.userDetailsService(userDetailsManager);
    auth.jdbcAuthentication().dataSource(userDetailsManager.getDataSource());

    if (userDetailsManager.userExists(ReConfConstants.SERVER_ROOT_USER)) {
        userDetailsManager.deleteUser(ReConfConstants.SERVER_ROOT_USER);
    }/*ww w  .j a v a  2s  .  com*/

    List<GrantedAuthority> authorities = new ArrayList<>();
    authorities.add(new SimpleGrantedAuthority("ROOT"));
    authorities.add(new SimpleGrantedAuthority("USER"));
    User user = new User(ReConfConstants.SERVER_ROOT_USER, rootUserPassword, authorities);
    userDetailsManager.createUser(user);
}

From source file:de.pksoftware.springstrap.basic.config.BasicWebSecurityConfig.java

/**
 * Configure the Authentication Manager for the example application. Set the UserDetailsService and a password encoder.
 *//*  w w  w  . j ava  2 s . co m*/
@Autowired
@Override
public void configureAuthenticationManager(AuthenticationManagerBuilder auth) throws Exception {
    auth.userDetailsService(userDetailsService).passwordEncoder(new BCryptPasswordEncoder());
}

From source file:com.jeanchampemont.notedown.config.WebSecurityConfiguration.java

@Autowired
public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
    auth.userDetailsService(userDetailsService).passwordEncoder(passwordEncoder());
}

From source file:com.tamnd.app.config.security.SpringSecurityConfig.java

@Autowired
public void configAuthBuilder(AuthenticationManagerBuilder builder) throws Exception {
    builder.userDetailsService(userDetailService).passwordEncoder(passwordEncoder());
}

From source file:hu.petabyte.redflags.web.cfg.SecurityRoles.java

@Autowired
public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
    auth.userDetailsService(userDetailsService()).passwordEncoder(new BCryptPasswordEncoder());
}

From source file:com.mysample.springbootsample.config.SecurityConfig.java

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

    auth.userDetailsService(customUserDetailsService);

    // In case of password encryption - for production site
    //auth.userDetailsService(customerUserDetailsService).passwordEncoder(passwordEncoder());
}

From source file:com.hillert.botanic.config.SecurityConfig.java

@Override
protected void configure(AuthenticationManagerBuilder authManagerBuilder) throws Exception {
    authManagerBuilder.userDetailsService(new DefaultUserDetailsService());
}