@Bean public AuthenticationUserDetailsService userDetailsService(){ GrantedAuthorityFromAssertionAttributesUserDetailsService uds = new GrantedAuthorityFromAssertionAttributesUserDetailsService( new String[]{"role"} ); return uds; }
@Bean public PreAuthenticatedAuthenticationProvider preAuthAuthenticationProvider( // final AuthenticationUserDetailsService<PreAuthenticatedAuthenticationToken> authenticationUserDetailsService) final AuthenticationUserDetailsService authenticationUserDetailsService) { return new PreAuthenticatedAuthenticationProvider(){{ setPreAuthenticatedUserDetailsService(authenticationUserDetailsService); }}; }
@Bean public PreAuthenticatedAuthenticationProvider preAuthAuthenticationProvider(final AuthenticationUserDetailsService authenticationUserDetailsService){ return new PreAuthenticatedAuthenticationProvider(){{ setPreAuthenticatedUserDetailsService(authenticationUserDetailsService); }}; }
/** * 用户自定义的AuthenticationUserDetailsService */ @Bean public AuthenticationUserDetailsService<CasAssertionAuthenticationToken> customUserDetailsService() { return new CustomUserDetailsService(); }
private AuthenticationUserDetailsService<PreAuthenticatedAuthenticationToken> x509v3ExtService() { return token -> new User(token.getName(), "", AuthorityUtils.createAuthorityList(ROLE_MTLS_USER)); }
@Bean public AuthenticationUserDetailsService<CasAssertionAuthenticationToken> customUserDetailsService() { return new CustomUserDetailsService(adminList()); }
@Override public void setPreAuthenticatedUserDetailsService(AuthenticationUserDetailsService aPreAuthenticatedUserDetailsService) { this.preAuthenticatedUserDetailsService = aPreAuthenticatedUserDetailsService; super.setPreAuthenticatedUserDetailsService(aPreAuthenticatedUserDetailsService); }
public GuestSupportingUserDetailsService(AuthenticationUserDetailsService<Authentication> nonGuestAuthenticationUserDetailsService) { this.nonGuestAuthenticationUserDetailsService = nonGuestAuthenticationUserDetailsService; }
/** * 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; }