当前位置: 首页>>代码示例>>Java>>正文


Java AuthenticationUserDetailsService类代码示例

本文整理汇总了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;
}
 
开发者ID:PacktPublishing,项目名称:Spring-Security-Third-Edition,代码行数:9,代码来源:CasConfig.java

示例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);
        }};
    }
 
开发者ID:PacktPublishing,项目名称:Spring-Security-Third-Edition,代码行数:10,代码来源:SecurityConfig.java

示例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);
    }};
}
 
开发者ID:PacktPublishing,项目名称:Spring-Security-Third-Edition,代码行数:7,代码来源:SecurityConfig.java

示例5: customUserDetailsService

import org.springframework.security.core.userdetails.AuthenticationUserDetailsService; //导入依赖的package包/类
/**
 * 用户自定义的AuthenticationUserDetailsService
 */
@Bean
public AuthenticationUserDetailsService<CasAssertionAuthenticationToken> customUserDetailsService() {
    return new CustomUserDetailsService();
}
 
开发者ID:mouxiao,项目名称:shootmimi,代码行数:8,代码来源:CasSecurityConfig.java

示例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));
}
 
开发者ID:cloudfoundry-incubator,项目名称:credhub,代码行数:4,代码来源:X509AuthenticationProvider.java

示例7: customUserDetailsService

import org.springframework.security.core.userdetails.AuthenticationUserDetailsService; //导入依赖的package包/类
@Bean
public AuthenticationUserDetailsService<CasAssertionAuthenticationToken> customUserDetailsService() {
	return new CustomUserDetailsService(adminList());
}
 
开发者ID:jgribonvald,项目名称:demo-spring-security-cas,代码行数:5,代码来源:SecurityConfiguration.java

示例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;
}
 
开发者ID:BandwidthOnDemand,项目名称:bandwidth-on-demand,代码行数:4,代码来源:GuestSupportingUserDetailsService.java

示例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;
}
 
开发者ID:pwheel,项目名称:spring-security-oauth2-client,代码行数:9,代码来源:OAuth2AuthenticationProvider.java


注:本文中的org.springframework.security.core.userdetails.AuthenticationUserDetailsService类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。