@Autowired protected void configureGlobal(AuthenticationManagerBuilder auth) throws Exception { auth.userDetailsService(userDetailsService); // .inMemoryAuthentication() // .withUser("user") // .password("password") // .roles("USER","ADMIN"); }
@Override protected void configure(AuthenticationManagerBuilder auth) throws Exception { // for "refresh_token" to work a real UserDetailsService is necessary // auth.inMemoryAuthentication() // .withUser("donald").password("d8ck").roles("USER"); auth.userDetailsService(userDetailsService); }
@Autowired public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception { BCryptPasswordEncoder passwordEncoder = passwordEncoder(); auth.userDetailsService(userDetailsService).passwordEncoder(passwordEncoder); /*auth.jdbcAuthentication().dataSource(dataSource) .usersByUsernameQuery("select name, '1', 1 from users where name = ?") .authoritiesByUsernameQuery( "select users.name, authorities.name from users join user_authorities on users.id = user_authorities.user_id join authorities on user_authorities.authority_id = authorities.id where users.name = ?"); */ }
/* * User-details services */ @Autowired public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception { auth // <T extends UserDetailsService> // DaoAuthenticationConfigurer<AuthenticationManagerBuilder,T> // userDetailsService(T userDetailsService) .userDetailsService(userDetailsService) .passwordEncoder(passwordEncoder); // System.out.println(passwordEncoder.encode("asdasdasd")); }
@Override protected void configure(AuthenticationManagerBuilder auth) throws Exception { auth.inMemoryAuthentication() .withUser("admin") .password("admin") .authorities(AuthorityUtils.createAuthorityList(Role.ROLE_ADMIN.toString())) .and() .withUser("user") .password("user") .authorities(AuthorityUtils.createAuthorityList(Role.ROLE_USER.toString())); auth.userDetailsService(userDetailsService()).passwordEncoder(passwordEncoder()); }
@Override protected void configure(AuthenticationManagerBuilder auth) throws Exception { auth.userDetailsService(userDetailsService); }
@Override public void init(AuthenticationManagerBuilder auth) throws Exception { auth.userDetailsService(rulerUserDetailService); }
@Autowired public void configureGlobal( @SuppressWarnings("SpringJavaAutowiringInspection") AuthenticationManagerBuilder builder) throws Exception { builder.userDetailsService(userDetailsService).passwordEncoder(shaPasswordEncoder()); }
@Autowired protected void registerAuthentication(final AuthenticationManagerBuilder auth) throws Exception { auth.userDetailsService(userDetailsService); }
// 自己实现DetailsService,完成自定义认证 @Override protected void configure(AuthenticationManagerBuilder auth) throws Exception { logger.info("进入自定义UserDetailsService-->config"); auth.userDetailsService(userService()); }
@Override public void configure(AuthenticationManagerBuilder auth) throws Exception { auth.userDetailsService(userDetailsService).passwordEncoder(User.PASSWORD_ENCODER); }
@Autowired public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception { auth.userDetailsService(mySQLUserDetailsService); }
// регистрируем нашу реализацию UserDetailsService // а также PasswordEncoder @Autowired public void registerGlobalAuthentication(AuthenticationManagerBuilder auth) throws Exception { auth.userDetailsService(userDetailsService).passwordEncoder(getPasswordEncoder()); }
@Autowired public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception { auth.userDetailsService(userDetailsService).passwordEncoder(passwordEncoder()); }
private void configureUserDetailsService(AuthenticationManagerBuilder auth) throws Exception { // @formatter:off auth.userDetailsService(userDetailsService()).passwordEncoder(passwordEncoder()); // @formatter:on }
@Autowired public void configureGlobalSecurity(AuthenticationManagerBuilder auth) throws Exception { auth.userDetailsService(userDetailsService); auth.authenticationProvider(authenticationProvider()); }
@Autowired public void configAuthBuilder(AuthenticationManagerBuilder builder) throws Exception { builder.userDetailsService(userDetailService); }
@Autowired public void configAuthentication(AuthenticationManagerBuilder auth) throws Exception { auth.userDetailsService(userDetailsService); }
@Override protected void configure(AuthenticationManagerBuilder auth) throws Exception { auth.userDetailsService(accountServiceImpl).passwordEncoder(EncodingUtils.passwordEncoder()); }
@Override protected void configure(AuthenticationManagerBuilder auth) throws Exception { auth.userDetailsService(userDetailsService).passwordEncoder(new BCryptPasswordEncoder()); }
@Override protected void configure(AuthenticationManagerBuilder auth) throws Exception { auth.userDetailsService(new UserDetailServiceImpl(userRepository)); }
@Override protected void configure(AuthenticationManagerBuilder authManagerBuilder) throws Exception { authManagerBuilder.userDetailsService(new CustomUserDetailsService()); }
@Override protected void registerAuthentication(AuthenticationManagerBuilder auth) throws Exception { PasswordEncoder encoder = encoder(); auth.userDetailsService(userService).passwordEncoder(encoder); }
@Autowired public void configureGlobal( AuthenticationManagerBuilder auth, CustomUserDetailsService customUserDetailsService) throws Exception { auth.userDetailsService(customUserDetailsService).passwordEncoder(new BCryptPasswordEncoder()); }
@Autowired public void configureGlobal(final AuthenticationManagerBuilder auth) throws Exception { auth.userDetailsService(userDetailsManager()); }