org.springframework.security.web.authentication.preauth.j2ee
Class AbstractPreAuthenticatedAuthenticationDetailsSource
java.lang.Object
org.springframework.security.authentication.AuthenticationDetailsSourceImpl
org.springframework.security.web.authentication.preauth.j2ee.AbstractPreAuthenticatedAuthenticationDetailsSource
- All Implemented Interfaces:
- org.springframework.security.authentication.AuthenticationDetailsSource
- Direct Known Subclasses:
- J2eeBasedPreAuthenticatedWebAuthenticationDetailsSource
public abstract class AbstractPreAuthenticatedAuthenticationDetailsSource
- extends org.springframework.security.authentication.AuthenticationDetailsSourceImpl
Base implementation for classes scenarios where the authentication details object is used
to store a list of authorities obtained from the context object (such as an HttpServletRequest)
passed to buildDetails(Object).
- Since:
- 2.0
- Author:
- Luke Taylor
| Methods inherited from class org.springframework.security.authentication.AuthenticationDetailsSourceImpl |
setClazz |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
logger
protected final org.apache.commons.logging.Log logger
j2eeMappableRoles
protected Set<String> j2eeMappableRoles
j2eeUserRoles2GrantedAuthoritiesMapper
protected org.springframework.security.core.authority.mapping.Attributes2GrantedAuthoritiesMapper j2eeUserRoles2GrantedAuthoritiesMapper
AbstractPreAuthenticatedAuthenticationDetailsSource
public AbstractPreAuthenticatedAuthenticationDetailsSource()
afterPropertiesSet
public void afterPropertiesSet()
throws Exception
- Check that all required properties have been set.
- Throws:
Exception
buildDetails
public Object buildDetails(Object context)
- Build the authentication details object. If the specified authentication
details class implements
MutableGrantedAuthoritiesContainer, a
list of pre-authenticated Granted Authorities will be set based on the
roles for the current user.
- Specified by:
buildDetails in interface org.springframework.security.authentication.AuthenticationDetailsSource- Overrides:
buildDetails in class org.springframework.security.authentication.AuthenticationDetailsSourceImpl
- See Also:
AuthenticationDetailsSource.buildDetails(Object)
getUserRoles
protected abstract Collection<String> getUserRoles(Object context,
Set<String> mappableRoles)
- Allows the roles of the current user to be determined from the context object
- Parameters:
context - the context object (an HttpRequest, PortletRequest etc)mappableRoles - the possible roles as determined by the MappableAttributesRetriever
- Returns:
- the subset of mappable roles which the current user has.
setMappableRolesRetriever
public void setMappableRolesRetriever(org.springframework.security.core.authority.mapping.MappableAttributesRetriever aJ2eeMappableRolesRetriever)
- Parameters:
aJ2eeMappableRolesRetriever - The MappableAttributesRetriever to use
setUserRoles2GrantedAuthoritiesMapper
public void setUserRoles2GrantedAuthoritiesMapper(org.springframework.security.core.authority.mapping.Attributes2GrantedAuthoritiesMapper mapper)
- Parameters:
mapper - The Attributes2GrantedAuthoritiesMapper to use