Here are the examples of the java api org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
596 Examples
19
Source : WebSecurityConfig.java
with GNU Affero General Public License v3.0
from zycSummer
with GNU Affero General Public License v3.0
from zycSummer
/**
* 用户验证
* @param auth
*/
@Override
public void configure(AuthenticationManagerBuilder auth) {
auth.authenticationProvider(miniAppAuthenticationProvider);
}
19
Source : WebSecurityConfig.java
with GNU Affero General Public License v3.0
from zycSummer
with GNU Affero General Public License v3.0
from zycSummer
/**
* 用户验证
* @param auth
*/
@Override
public void configure(AuthenticationManagerBuilder auth) {
auth.authenticationProvider(adminAuthenticationProvider);
}
19
Source : SecurityConfig.java
with Apache License 2.0
from Zuehlke
with Apache License 2.0
from Zuehlke
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
auth.userDetailsService(userDetailsService).preplacedwordEncoder(preplacedwordEncoder);
}
19
Source : WebSecurityConfig.java
with Apache License 2.0
from Zoctan
with Apache License 2.0
from Zoctan
@Override
protected void configure(final AuthenticationManagerBuilder auth) throws Exception {
auth.userDetailsService(this.userDetailsService()).preplacedwordEncoder(this.preplacedwordEncoder());
}
19
Source : WebSecurityConfig.java
with Apache License 2.0
from Zoctan
with Apache License 2.0
from Zoctan
@Override
protected void configure(final AuthenticationManagerBuilder auth) throws Exception {
auth.userDetailsService(this.userDetailsService()).preplacedwordEncoder(WebSecurityConfig.preplacedwordEncoder());
}
19
Source : SpringSecurityConfig.java
with GNU General Public License v3.0
from zhshuixian
with GNU General Public License v3.0
from zhshuixian
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
// 设置密码加密方式
auth.userDetailsService(userDetailsService).preplacedwordEncoder(preplacedwordEncoder());
}
19
Source : WebServerSecurityConfig.java
with Apache License 2.0
from zhoutaoo
with Apache License 2.0
from zhoutaoo
/**
* 注入自定义的userDetailsService实现,获取用户信息,设置密码加密方式
*
* @param authenticationManagerBuilder
* @throws Exception
*/
@Override
protected void configure(AuthenticationManagerBuilder authenticationManagerBuilder) throws Exception {
authenticationManagerBuilder.userDetailsService(userDetailsService).preplacedwordEncoder(preplacedwordEncoder());
// 设置手机验证码登陆的AuthenticationProvider
authenticationManagerBuilder.authenticationProvider(mobileAuthenticationProvider());
}
19
Source : WebSecurityConfig.java
with Apache License 2.0
from zhoubiao188
with Apache License 2.0
from zhoubiao188
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
// 使用内存模拟数据库查询的用户
auth.inMemoryAuthentication().withUser("admin").preplacedword(preplacedwordEncoder().encode("123456")).roles("ADMIN");
}
19
Source : WebSecurityConfig.java
with Apache License 2.0
from zhaoguhong
with Apache License 2.0
from zhaoguhong
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
auth.userDetailsService(userDetailsService).preplacedwordEncoder(preplacedwordEncoder());
}
19
Source : ValidateCodeAutoConfigurerAware.java
with MIT License
from ZeroOrInfinity
with MIT License
from ZeroOrInfinity
@SuppressWarnings("RedundantThrows")
@Override
public void configure(AuthenticationManagerBuilder auth) throws Exception {
// dto nothing
}
19
Source : Auth2AutoHttpSecurityAware.java
with MIT License
from ZeroOrInfinity
with MIT License
from ZeroOrInfinity
@SuppressWarnings("RedundantThrows")
@Override
public void configure(AuthenticationManagerBuilder auth) throws Exception {
// do nothing
}
19
Source : MdcLogAutoConfigurerAware.java
with MIT License
from ZeroOrInfinity
with MIT License
from ZeroOrInfinity
@Override
public void configure(AuthenticationManagerBuilder auth) {
// do nothing
}
19
Source : JwtAutoConfigurerAware.java
with MIT License
from ZeroOrInfinity
with MIT License
from ZeroOrInfinity
@Override
public void configure(AuthenticationManagerBuilder auth) {
}
19
Source : UriAuthorizeConfigurerAware.java
with MIT License
from ZeroOrInfinity
with MIT License
from ZeroOrInfinity
@Override
public void configure(AuthenticationManagerBuilder auth) {
// TODO
}
19
Source : DemoSecurityConfigurerAware.java
with MIT License
from ZeroOrInfinity
with MIT License
from ZeroOrInfinity
@Override
public void configure(AuthenticationManagerBuilder auth) throws Exception {
// TODO
}
19
Source : TenantAutoConfigurerAware.java
with MIT License
from ZeroOrInfinity
with MIT License
from ZeroOrInfinity
@Override
public void configure(AuthenticationManagerBuilder auth) {
// nothing
}
19
Source : WebSecurityConfiguration.java
with Apache License 2.0
from zeldan
with Apache License 2.0
from zeldan
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
auth.userDetailsService(userDetailsService);
auth.authenticationProvider(accountAuthenticationProvider);
}
19
Source : WebSecurityConfig.java
with Apache License 2.0
from zeebe-io
with Apache License 2.0
from zeebe-io
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
auth.authenticationProvider(authProvider());
}
19
Source : SecurityConfiguration.java
with MIT License
from YunaiV
with MIT License
from YunaiV
/**
* 身份认证接口
*/
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
auth.userDetailsService(userDetailsService).preplacedwordEncoder(preplacedwordEncoder());
}
19
Source : SpringSecurityConfig.java
with Apache License 2.0
from yujunhao8831
with Apache License 2.0
from yujunhao8831
@Autowired
public void configureAuthentication(AuthenticationManagerBuilder authenticationManagerBuilder) throws Exception {
authenticationManagerBuilder.userDetailsService(this.userDetailsService).preplacedwordEncoder(this.preplacedwordEncoder);
}
19
Source : WebSecurityConfig.java
with Apache License 2.0
from yugabyte
with Apache License 2.0
from yugabyte
@Autowired
public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
auth.userDetailsService(userDetailsService).preplacedwordEncoder(bCryptPreplacedwordEncoder());
}
19
Source : WebSecurityConfig.java
with MIT License
from yuequan1997
with MIT License
from yuequan1997
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
auth.inMemoryAuthentication().withUser("test1").preplacedword(preplacedwordEncoder.encode("123456")).authorities("USER");
}
19
Source : WebSecurityConfig.java
with MIT License
from yuequan1997
with MIT License
from yuequan1997
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
auth.inMemoryAuthentication().withUser(User.withUsername("user_1").preplacedword(preplacedwordEncoder.encode("123456")).authorities("USER"));
}
19
Source : SecurityConfigurerAdapter.java
with Apache License 2.0
from yihonglei
with Apache License 2.0
from yihonglei
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
auth.userDetailsService(userDetail).preplacedwordEncoder(preplacedwordEncoder());
}
19
Source : SecurityConfig.java
with MIT License
from yangzongzhuan
with MIT License
from yangzongzhuan
/**
* 身份认证接口
*/
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
auth.userDetailsService(userDetailsService).preplacedwordEncoder(bCryptPreplacedwordEncoder());
}
19
Source : WebSecurityConfiguration.java
with Apache License 2.0
from yanghaiji
with Apache License 2.0
from yanghaiji
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
// 使用自定义认证与授权
auth.userDetailsService(userDetailsService());
}
19
Source : SecurityConfig.java
with Apache License 2.0
from yanghaiji
with Apache License 2.0
from yanghaiji
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
auth.userDetailsService(userDetailService).preplacedwordEncoder(preplacedwordEncoder());
}
19
Source : SecurityConfiguration.java
with Apache License 2.0
from xuyisu
with Apache License 2.0
from xuyisu
@Autowired
public void globalUserDetails(AuthenticationManagerBuilder auth) throws Exception {
auth.userDetailsService(userDetailsService).preplacedwordEncoder(bCryptPreplacedwordEncoder());
}
19
Source : UaaWebSecurityConfiguration.java
with Apache License 2.0
from xm-online
with Apache License 2.0
from xm-online
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
auth.authenticationProvider(uaaAuthenticationProvider);
auth.authenticationProvider(tfaOtpAuthenticationProvider);
}
19
Source : SecurityConfiguration.java
with MIT License
from xkcoding
with MIT License
from xkcoding
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
auth.userDetailsService(userDetailsService());
}
19
Source : WebSecurityConfig.java
with Apache License 2.0
from xjjdog
with Apache License 2.0
from xjjdog
@Autowired
public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
auth.userDetailsService(userDetailsService).preplacedwordEncoder(preplacedwordEncoder());
}
19
Source : SecurityConfig.java
with MIT License
from xiuhuai
with MIT License
from xiuhuai
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
auth.userDetailsService(UserSecurityService()).preplacedwordEncoder(new BCryptPreplacedwordEncoder() {
});
}
19
Source : WebSecurityConfig.java
with Apache License 2.0
from xiuhuai
with Apache License 2.0
from xiuhuai
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
auth.userDetailsService(Service()).preplacedwordEncoder(new BCryptPreplacedwordEncoder() {
});
}
19
Source : WebSecurityConfig.java
with Apache License 2.0
from xiuhuai
with Apache License 2.0
from xiuhuai
@Autowired
public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
auth.inMemoryAuthentication().preplacedwordEncoder(new BCryptPreplacedwordEncoder()).withUser("admin").preplacedword("$2a$10$Q21imUyxDeshQ2tQBUfJKuBHbmuyTsZYoCMRmGi5UcOIavevauZwS").roles("USER");
}
19
Source : WebSecurityConfigForJWT.java
with Apache License 2.0
from xiuhuai
with Apache License 2.0
from xiuhuai
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
auth.userDetailsService(JwtUserSecurityService()).preplacedwordEncoder(new BCryptPreplacedwordEncoder() {
});
}
19
Source : WebSecurityConfig.java
with Apache License 2.0
from xiaoqiangge
with Apache License 2.0
from xiaoqiangge
@Autowired
public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
auth.inMemoryAuthentication().withUser("user").preplacedword("preplacedword").roles("user_group");
}
19
Source : WebSecurityConfig.java
with Apache License 2.0
from xiaomaipu
with Apache License 2.0
from xiaomaipu
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
auth.userDetailsService(customUserService());
}
19
Source : WebSecurityConfigurer.java
with Apache License 2.0
from wuyichen24
with Apache License 2.0
from wuyichen24
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
// Store in memory
// auth
// .inMemoryAuthentication()
// .withUser("john.carnell").preplacedword("preplacedword1").roles("USER") // Define the first user: john.carnell with the preplacedword "preplacedword1" and the role "USER"
// .and()
// .withUser("william.woodward").preplacedword("preplacedword2").roles("USER", "ADMIN"); // Define the second user: william.woodward with the preplacedword "preplacedword2" and the role "ADMIN"
// Store in databse
auth.jdbcAuthentication().dataSource(dataSource).preplacedwordEncoder(preplacedwordEncoder);
}
19
Source : WebSecurityConfigurer.java
with Apache License 2.0
from wuyichen24
with Apache License 2.0
from wuyichen24
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
auth.inMemoryAuthentication().withUser("john.carnell").preplacedword("preplacedword1").roles(// Define the first user: john.carnell with the preplacedword "preplacedword1" and the role "USER"
"USER").and().withUser("william.woodward").preplacedword("preplacedword2").roles("USER", // Define the second user: william.woodward with the preplacedword "preplacedword2" and the role "ADMIN"
"ADMIN");
}
19
Source : SecurityConfig.java
with MIT License
from whichard
with MIT License
from whichard
// @Override
// protected void configure(HttpSecurity http) throws Exception {
// http.authorizeRequests().antMatchers("/css/**", "/js/**", "/fonts/**", "/index").permitAll() // 都可以访问
// .antMatchers("/h2-console/**").permitAll() // 都可以访问
// .antMatchers("/admins/**").hasRole("ADMIN") // 需要相应的角色才能访问
// .and()
// .formLogin() //基于 Form 表单登录验证
// .loginPage("/login").failureUrl("/login-error") // 自定义登录界面
// .and().rememberMe().key(KEY) // 启用 remember me
// .and().exceptionHandling().accessDeniedPage("/403"); // 处理异常,拒绝访问就重定向到 403 页面
// http.csrf().ignoringAntMatchers("/h2-console/**"); // 禁用 H2 控制台的 CSRF 防护
// http.headers().frameOptions().sameOrigin();// 允许来自同一来源的H2 控制台的请求
// // .and().headers().defaultsDisabled().cacheControl(); 原生的开启cacheControl
// }
/**
* 认证信息管理
*
* @param auth
* @throws Exception
*/
@Autowired
public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
auth.userDetailsService(userDetailsService);
auth.authenticationProvider(authenticationProvider());
}
19
Source : SecurityConfig.java
with MIT License
from wells2333
with MIT License
from wells2333
@Autowired
public void configureGlobal(AuthenticationManagerBuilder auth) {
auth.authenticationProvider(authProvider());
}
19
Source : BrowerSecurityConfig.java
with Apache License 2.0
from WeBankFinTech
with Apache License 2.0
from WeBankFinTech
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
auth.userDetailsService(userDetailService).preplacedwordEncoder(new PreplacedwordEncoder() {
@Override
public String encode(CharSequence rawPreplacedword) {
return rawPreplacedword.toString();
}
@Override
public boolean matches(CharSequence rawPreplacedword, String encodedPreplacedword) {
return Objects.equals(rawPreplacedword.toString(), encodedPreplacedword);
}
});
}
19
Source : WebSecurityConfig.java
with GNU General Public License v3.0
from voyages-sncf-technologies
with GNU General Public License v3.0
from voyages-sncf-technologies
@Override
protected void configure(AuthenticationManagerBuilder authManagerBuilder) {
authManagerBuilder.authenticationProvider(authenticationProvider);
// Nécessaire pour LdapUserInfoRepository
authManagerBuilder.eraseCredentials(false);
}
19
Source : LocalWebSecurityConfig.java
with GNU General Public License v3.0
from voyages-sncf-technologies
with GNU General Public License v3.0
from voyages-sncf-technologies
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
auth.inMemoryAuthentication().withUser("tech").preplacedword("{noop}preplacedword").authorities(new GlobalRole(IS_TECH)).and().withUser("prod").preplacedword("{noop}preplacedword").authorities(new GlobalRole(IS_PROD)).and().withUser("user").preplacedword("{noop}preplacedword").roles("USER");
}
19
Source : WebSecurityConfig.java
with Apache License 2.0
from V1toss
with Apache License 2.0
from V1toss
@Autowired
public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
auth.userDetailsService(myUserDetailService);
}
19
Source : SecurityConfig.java
with Apache License 2.0
from ukihsoroy
with Apache License 2.0
from ukihsoroy
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
// 设置自定义的userDetailsService以及密码编码器
auth.userDetailsService(userDetailsServiceImpl).preplacedwordEncoder(bCryptPreplacedwordEncoder());
}
19
Source : WebSecurityConfig.java
with Apache License 2.0
from ukihsoroy
with Apache License 2.0
from ukihsoroy
@Autowired
public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
auth.inMemoryAuthentication().withUser("user").preplacedword("preplacedword").roles("USER");
}
19
Source : WebSecurityConfig.java
with Apache License 2.0
from ukihsoroy
with Apache License 2.0
from ukihsoroy
/**
* 添加 UserDetailsService, 实现自定义登录校验
*/
@Override
protected void configure(AuthenticationManagerBuilder builder) throws Exception {
builder.userDetailsService(userDetailsService);
}
19
Source : SecurityConfiguration.java
with Apache License 2.0
from u014427391
with Apache License 2.0
from u014427391
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
// auth.inMemoryAuthentication()
// auth.inMemoryAuthentication()
// .withUser("nicky")
// .preplacedword("{noop}123")
// .roles("admin");
auth.userDetailsService(userDetailsService).preplacedwordEncoder(new CustomPreplacedwordEncoder());
auth.parentAuthenticationManager(authenticationManagerBean());
}
19
Source : SecurityConfiguration.java
with Apache License 2.0
from u014427391
with Apache License 2.0
from u014427391
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
// auth.inMemoryAuthentication()
auth.inMemoryAuthentication().withUser("nicky").preplacedword(bcryptPreplacedwordEncoder().encode("123")).roles("admin");
}
See More Examples