org.springframework.security.web.authentication.preauth.j2ee
Class J2eeBasedPreAuthenticatedWebAuthenticationDetailsSource

java.lang.Object
  extended by org.springframework.security.authentication.AuthenticationDetailsSourceImpl
      extended by org.springframework.security.web.authentication.preauth.j2ee.AbstractPreAuthenticatedAuthenticationDetailsSource
          extended by 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 GrantedAuthoritys and stores these in the authentication details object (.

Since:
2.0
Author:
Ruud Senden

Field Summary
 
Fields inherited from class org.springframework.security.web.authentication.preauth.j2ee.AbstractPreAuthenticatedAuthenticationDetailsSource
j2eeMappableRoles, j2eeUserRoles2GrantedAuthoritiesMapper, logger
 
Constructor Summary
J2eeBasedPreAuthenticatedWebAuthenticationDetailsSource()
          Public constructor which overrides the default AuthenticationDetails class to be used.
 
Method Summary
protected  Collection<String> getUserRoles(Object context, Set<String> mappableRoles)
          Obtains the list of user roles based on the current user's J2EE roles.
 
Methods inherited from class org.springframework.security.web.authentication.preauth.j2ee.AbstractPreAuthenticatedAuthenticationDetailsSource
afterPropertiesSet, buildDetails, setMappableRolesRetriever, setUserRoles2GrantedAuthoritiesMapper
 
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
 

Constructor Detail

J2eeBasedPreAuthenticatedWebAuthenticationDetailsSource

public J2eeBasedPreAuthenticatedWebAuthenticationDetailsSource()
Public constructor which overrides the default AuthenticationDetails class to be used.

Method Detail

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:
request - The request against which isUserInRole will be called for each role name returned by the MappableAttributesRetriever.
Returns:
GrantedAuthority[] mapped from the user's J2EE roles.


Copyright © 2004-2009 SpringSource, Inc. All Rights Reserved.