org.springframework.security.web.authentication.preauth.j2ee
Class J2eeBasedPreAuthenticatedWebAuthenticationDetailsSource
java.lang.Object
org.springframework.security.authentication.AuthenticationDetailsSourceImpl
org.springframework.security.web.authentication.preauth.j2ee.AbstractPreAuthenticatedAuthenticationDetailsSource
org.springframework.security.web.authentication.preauth.j2ee.J2eeBasedPreAuthenticatedWebAuthenticationDetailsSource
- All Implemented Interfaces:
- AuthenticationDetailsSource
public class J2eeBasedPreAuthenticatedWebAuthenticationDetailsSource
- extends AbstractPreAuthenticatedAuthenticationDetailsSource
Implementation of AuthenticationDetailsSource which converts the user's J2EE roles (as obtained by calling
HttpServletRequest.isUserInRole(String)
) into GrantedAuthority
s and stores these in the authentication
details object.
- Since:
- 2.0
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
J2eeBasedPreAuthenticatedWebAuthenticationDetailsSource
public J2eeBasedPreAuthenticatedWebAuthenticationDetailsSource()
- Public constructor which overrides the default
WebAuthenticationDetails
class to be used.
getUserRoles
protected Collection<String> getUserRoles(Object context,
Set<String> mappableRoles)
- Obtains the list of user roles based on the current user's J2EE roles.
- Specified by:
getUserRoles
in class AbstractPreAuthenticatedAuthenticationDetailsSource
- 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.