public class

PreAuthenticatedGrantedAuthoritiesUserDetailsService

extends Object
implements AuthenticationUserDetailsService<T extends Authentication>
java.lang.Object
   ↳ org.springframework.security.web.authentication.preauth.PreAuthenticatedGrantedAuthoritiesUserDetailsService

Class Overview

This AuthenticationUserDetailsService implementation creates a UserDetails object based solely on the information contained in the given PreAuthenticatedAuthenticationToken. The user name is set to the name as returned by PreAuthenticatedAuthenticationToken.getName(), the password is set to a fixed dummy value (it will not be used by the PreAuthenticatedAuthenticationProvider anyway), and the Granted Authorities are retrieved from the details object as returned by PreAuthenticatedAuthenticationToken.getDetails().

The details object as returned by PreAuthenticatedAuthenticationToken.getDetails() must implement the GrantedAuthoritiesContainer interface for this implementation to work.

Summary

Public Constructors
PreAuthenticatedGrantedAuthoritiesUserDetailsService()
Public Methods
final UserDetails loadUserDetails(PreAuthenticatedAuthenticationToken token)
Get a UserDetails object based on the user name contained in the given token, and the GrantedAuthorities as returned by the GrantedAuthoritiesContainer implementation as returned by the token.getDetails() method.
Protected Methods
UserDetails createuserDetails(Authentication token, Collection<? extends GrantedAuthority> authorities)
Creates the final UserDetails object.
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.springframework.security.core.userdetails.AuthenticationUserDetailsService

Public Constructors

public PreAuthenticatedGrantedAuthoritiesUserDetailsService ()

Public Methods

public final UserDetails loadUserDetails (PreAuthenticatedAuthenticationToken token)

Get a UserDetails object based on the user name contained in the given token, and the GrantedAuthorities as returned by the GrantedAuthoritiesContainer implementation as returned by the token.getDetails() method.

Protected Methods

protected UserDetails createuserDetails (Authentication token, Collection<? extends GrantedAuthority> authorities)

Creates the final UserDetails object. Can be overridden to customize the contents.

Parameters
token the authentication request token
authorities the pre-authenticated authorities.