本文整理汇总了Java中org.springframework.security.core.userdetails.AuthenticationUserDetailsService类的典型用法代码示例。如果您正苦于以下问题:Java AuthenticationUserDetailsService类的具体用法?Java AuthenticationUserDetailsService怎么用?Java AuthenticationUserDetailsService使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AuthenticationUserDetailsService类属于org.springframework.security.core.userdetails包,在下文中一共展示了AuthenticationUserDetailsService类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: userDetailsService
import org.springframework.security.core.userdetails.AuthenticationUserDetailsService; //导入依赖的package包/类
@Bean
public AuthenticationUserDetailsService userDetailsService(){
GrantedAuthorityFromAssertionAttributesUserDetailsService uds =
new GrantedAuthorityFromAssertionAttributesUserDetailsService(
new String[]{"role"}
);
return uds;
}
示例2: preAuthAuthenticationProvider
import org.springframework.security.core.userdetails.AuthenticationUserDetailsService; //导入依赖的package包/类
@Bean
public PreAuthenticatedAuthenticationProvider preAuthAuthenticationProvider(
// final AuthenticationUserDetailsService<PreAuthenticatedAuthenticationToken> authenticationUserDetailsService)
final AuthenticationUserDetailsService authenticationUserDetailsService)
{
return new PreAuthenticatedAuthenticationProvider(){{
setPreAuthenticatedUserDetailsService(authenticationUserDetailsService);
}};
}
示例3: should_delegate_to_user_details_service_for_non_guest_principle
import org.springframework.security.core.userdetails.AuthenticationUserDetailsService; //导入依赖的package包/类
@Test
public void should_delegate_to_user_details_service_for_non_guest_principle() throws Exception {
@SuppressWarnings("unchecked")
AuthenticationUserDetailsService<Authentication> nonGuestUserDetailsService = mock(AuthenticationUserDetailsService.class);
GuestSupportingUserDetailsService subject = new GuestSupportingUserDetailsService(nonGuestUserDetailsService);
UserDetails nonGuestUser = new User("username", "pwd", Collections.<GrantedAuthority>emptyList());
when(nonGuestUserDetailsService.loadUserDetails(notNull(Authentication.class))).thenReturn(nonGuestUser);
UserDetails actualUser = subject.loadUserDetails(new PreAuthenticatedAuthenticationToken(new RichPrincipal("nameId", "displayName", "[email protected]"), null));
assertThat(actualUser, is(nonGuestUser));
}
开发者ID:BandwidthOnDemand,项目名称:bandwidth-on-demand,代码行数:12,代码来源:GuestSupportingUserDetailsServiceTest.java
示例4: preAuthAuthenticationProvider
import org.springframework.security.core.userdetails.AuthenticationUserDetailsService; //导入依赖的package包/类
@Bean
public PreAuthenticatedAuthenticationProvider preAuthAuthenticationProvider(final AuthenticationUserDetailsService authenticationUserDetailsService){
return new PreAuthenticatedAuthenticationProvider(){{
setPreAuthenticatedUserDetailsService(authenticationUserDetailsService);
}};
}
示例5: customUserDetailsService
import org.springframework.security.core.userdetails.AuthenticationUserDetailsService; //导入依赖的package包/类
/**
* 用户自定义的AuthenticationUserDetailsService
*/
@Bean
public AuthenticationUserDetailsService<CasAssertionAuthenticationToken> customUserDetailsService() {
return new CustomUserDetailsService();
}
示例6: x509v3ExtService
import org.springframework.security.core.userdetails.AuthenticationUserDetailsService; //导入依赖的package包/类
private AuthenticationUserDetailsService<PreAuthenticatedAuthenticationToken> x509v3ExtService() {
return token -> new User(token.getName(), "", AuthorityUtils.createAuthorityList(ROLE_MTLS_USER));
}
示例7: customUserDetailsService
import org.springframework.security.core.userdetails.AuthenticationUserDetailsService; //导入依赖的package包/类
@Bean
public AuthenticationUserDetailsService<CasAssertionAuthenticationToken> customUserDetailsService() {
return new CustomUserDetailsService(adminList());
}
示例8: setPreAuthenticatedUserDetailsService
import org.springframework.security.core.userdetails.AuthenticationUserDetailsService; //导入依赖的package包/类
@Override
public void setPreAuthenticatedUserDetailsService(AuthenticationUserDetailsService aPreAuthenticatedUserDetailsService) {
this.preAuthenticatedUserDetailsService = aPreAuthenticatedUserDetailsService;
super.setPreAuthenticatedUserDetailsService(aPreAuthenticatedUserDetailsService);
}
开发者ID:ozoneplatform,项目名称:owf-security,代码行数:6,代码来源:CachingPreAuthenticatedAuthenticationProvider.java
示例9: GuestSupportingUserDetailsService
import org.springframework.security.core.userdetails.AuthenticationUserDetailsService; //导入依赖的package包/类
public GuestSupportingUserDetailsService(AuthenticationUserDetailsService<Authentication> nonGuestAuthenticationUserDetailsService) {
this.nonGuestAuthenticationUserDetailsService = nonGuestAuthenticationUserDetailsService;
}
示例10: setAuthenticatedUserDetailsService
import org.springframework.security.core.userdetails.AuthenticationUserDetailsService; //导入依赖的package包/类
/**
* Set the AuthenticatedUserDetailsService to be used to load the {@code UserDetails} for the authenticated user.
*
* @param uds The {@link AuthenticationUserDetailsService} to use.
*/
public void setAuthenticatedUserDetailsService(AuthenticationUserDetailsService<OAuth2AuthenticationToken> uds) {
this.authenticatedUserDetailsService = uds;
}