本文整理汇总了Java中org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder.authenticationProvider方法的典型用法代码示例。如果您正苦于以下问题:Java AuthenticationManagerBuilder.authenticationProvider方法的具体用法?Java AuthenticationManagerBuilder.authenticationProvider怎么用?Java AuthenticationManagerBuilder.authenticationProvider使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder
的用法示例。
在下文中一共展示了AuthenticationManagerBuilder.authenticationProvider方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: configureGlobal
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; //导入方法依赖的package包/类
@Autowired
public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
if (settingsService.isLdapEnabled()) {
auth.ldapAuthentication()
.contextSource()
.managerDn(settingsService.getLdapManagerDn())
.managerPassword(settingsService.getLdapManagerPassword())
.url(settingsService.getLdapUrl())
.and()
.userSearchFilter(settingsService.getLdapSearchFilter())
.userDetailsContextMapper(customUserDetailsContextMapper);
}
auth.userDetailsService(securityService);
String jwtKey = settingsService.getJWTKey();
if(StringUtils.isBlank(jwtKey)) {
logger.warn("Generating new jwt key");
jwtKey = JWTSecurityService.generateKey();
settingsService.setJWTKey(jwtKey);
settingsService.save();
}
auth.authenticationProvider(new JWTAuthenticationProvider(jwtKey));
}
示例2: configure
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; //导入方法依赖的package包/类
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
// without salt
//auth.userDetailsService(userDetailsService).passwordEncoder(md5PasswordEncoder());
// with salt
auth.authenticationProvider(authProvider());
auth.eraseCredentials(false);
}
示例3: configureGlobal
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; //导入方法依赖的package包/类
@Autowired
public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
auth.userDetailsService(myUserDetailService);
auth.authenticationProvider(rememberMeAuthenticationProvider());
// auth.jdbcAuthentication()
// .dataSource(dataSource)
// .withUser("user").password("password").roles("USER").and()
// .withUser("admin").password("password").roles("USER", "ADMIN");
}
示例4: configure
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; //导入方法依赖的package包/类
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
auth.authenticationProvider(authenticationProvider);
}
示例5: configure
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; //导入方法依赖的package包/类
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
auth.authenticationProvider(new JwtAuthenticationProvider());
customizeAuthenticationManager(auth);
}
示例6: configure
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; //导入方法依赖的package包/类
@Override
protected void configure(AuthenticationManagerBuilder auth) {
auth.authenticationProvider(agentAuthenticationProvider);
auth.authenticationProvider(jwtAuthenticationProvider);
}
示例7: configure
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; //导入方法依赖的package包/类
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
auth.authenticationProvider(authProvider());
auth.eraseCredentials(false);
}
示例8: configure
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; //导入方法依赖的package包/类
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
auth.authenticationProvider(authProvider());
auth.eraseCredentials(false);
}
示例9: customizeAuthenticationManager
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; //导入方法依赖的package包/类
@Override
protected void customizeAuthenticationManager(AuthenticationManagerBuilder auth) {
AuthenticationProvider usernamePasswordAuthenticationProvider =
lookup("usernamePasswordAuthenticationProvider");
auth.authenticationProvider(usernamePasswordAuthenticationProvider);
}
示例10: configure
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; //导入方法依赖的package包/类
@Override
protected void configure(final AuthenticationManagerBuilder auth) throws Exception {
auth.userDetailsService(userDetailsService);
auth.authenticationProvider(accountAuthenticationProvider);
}
示例11: configure
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; //导入方法依赖的package包/类
@Override
protected void configure(AuthenticationManagerBuilder authBuilder) {
authBuilder.authenticationProvider(this.authProvider);
}
开发者ID:PacktPublishing,项目名称:Building-Web-Apps-with-Spring-5-and-Angular,代码行数:5,代码来源:SecurityConfiguration.java
示例12: configure
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; //导入方法依赖的package包/类
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
// Database authentication provider
auth.authenticationProvider(authenticationProvider);
}
示例13: configure
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; //导入方法依赖的package包/类
@Override
protected void configure(AuthenticationManagerBuilder auth) {
auth.authenticationProvider(ajaxAuthenticationProvider);
auth.authenticationProvider(jwtAuthenticationProvider);
}
示例14: configure
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; //导入方法依赖的package包/类
/**
* Configure AuthenticationManager.
*
* NOTE:
* Due to a known limitation with JavaConfig:
* <a href="https://jira.spring.io/browse/SPR-13779">
* https://jira.spring.io/browse/SPR-13779</a>
*
* We cannot use the following to expose a {@link UserDetailsManager}
* <pre>
* http.authorizeRequests()
* </pre>
*
* In order to expose {@link UserDetailsManager} as a bean, we must create @Bean
*
* @see {@link super.userDetailsService()}
* @see {@link com.packtpub.springsecurity.service.DefaultCalendarService}
*
* @param auth AuthenticationManagerBuilder
* @throws Exception Authentication exception
*/
@Override
public void configure(final AuthenticationManagerBuilder auth) throws Exception {
auth
.authenticationProvider(calendarUserAuthenticationProvider)
;
}
示例15: configure
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; //导入方法依赖的package包/类
/**
* Configure AuthenticationManager.
*
* NOTE:
* Due to a known limitation with JavaConfig:
* <a href="https://jira.spring.io/browse/SPR-13779">
* https://jira.spring.io/browse/SPR-13779</a>
*
* We cannot use the following to expose a {@link UserDetailsManager}
* <pre>
* http.authorizeRequests()
* </pre>
*
* In order to expose {@link UserDetailsManager} as a bean, we must create @Bean
*
* @see {@link super.userDetailsService()}
* @see {@link com.packtpub.springsecurity.service.DefaultCalendarService}
*
* @param auth AuthenticationManagerBuilder
* @throws Exception Authentication exception
*/
@Override
public void configure(final AuthenticationManagerBuilder auth) throws Exception {
auth
.authenticationProvider(calendarUserAuthenticationProvider)
// .userDetailsService(userDetailsService)
// .passwordEncoder(passwordEncoder)
;
}