public class

J2eeBasedPreAuthenticatedWebAuthenticationDetailsSource

extends Object
implements InitializingBean AuthenticationDetailsSource<C, T>
java.lang.Object
   ↳ org.springframework.security.web.authentication.preauth.j2ee.J2eeBasedPreAuthenticatedWebAuthenticationDetailsSource

Class Overview

Implementation of AuthenticationDetailsSource which converts the user's J2EE roles (as obtained by calling isUserInRole(String)) into GrantedAuthoritys and stores these in the authentication details object.

Summary

Fields
protected Set<String> j2eeMappableRoles The role attributes returned by the configured MappableAttributesRetriever
protected Attributes2GrantedAuthoritiesMapper j2eeUserRoles2GrantedAuthoritiesMapper
protected final Log logger
Public Constructors
J2eeBasedPreAuthenticatedWebAuthenticationDetailsSource()
Public Methods
void afterPropertiesSet()
Check that all required properties have been set.
PreAuthenticatedGrantedAuthoritiesWebAuthenticationDetails buildDetails(HttpServletRequest context)
Builds the authentication details object.
void setMappableRolesRetriever(MappableAttributesRetriever aJ2eeMappableRolesRetriever)
void setUserRoles2GrantedAuthoritiesMapper(Attributes2GrantedAuthoritiesMapper mapper)
Protected Methods
Collection<String> getUserRoles(HttpServletRequest request)
Obtains the list of user roles based on the current user's JEE roles.
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.springframework.beans.factory.InitializingBean
From interface org.springframework.security.authentication.AuthenticationDetailsSource

Fields

protected Set<String> j2eeMappableRoles

The role attributes returned by the configured MappableAttributesRetriever

protected Attributes2GrantedAuthoritiesMapper j2eeUserRoles2GrantedAuthoritiesMapper

protected final Log logger

Public Constructors

public J2eeBasedPreAuthenticatedWebAuthenticationDetailsSource ()

Public Methods

public void afterPropertiesSet ()

Check that all required properties have been set.

Throws
Exception

public PreAuthenticatedGrantedAuthoritiesWebAuthenticationDetails buildDetails (HttpServletRequest context)

Builds the authentication details object.

public void setMappableRolesRetriever (MappableAttributesRetriever aJ2eeMappableRolesRetriever)

Parameters
aJ2eeMappableRolesRetriever The MappableAttributesRetriever to use

public void setUserRoles2GrantedAuthoritiesMapper (Attributes2GrantedAuthoritiesMapper mapper)

Parameters
mapper The Attributes2GrantedAuthoritiesMapper to use

Protected Methods

protected Collection<String> getUserRoles (HttpServletRequest request)

Obtains the list of user roles based on the current user's JEE roles. The isUserInRole(String) method is called for each of the values in the j2eeMappableRoles set to determine if that role should be assigned to the user.

Parameters
request the request which should be used to extract the user's roles.
Returns
  • The subset of j2eeMappableRoles which applies to the current user making the request.