org.jasig.springframework.security.portlet.authentication
Class PrimaryAttributePortletPreAuthenticatedAuthenticationDetailsSource

java.lang.Object
  extended by org.jasig.springframework.security.portlet.authentication.PortletPreAuthenticatedAuthenticationDetailsSource
      extended by org.jasig.springframework.security.portlet.authentication.PrimaryAttributePortletPreAuthenticatedAuthenticationDetailsSource
All Implemented Interfaces:
org.springframework.security.authentication.AuthenticationDetailsSource<javax.portlet.PortletRequest,org.jasig.springframework.security.portlet.authentication.PreAuthenticatedGrantedAuthoritiesPortletAuthenticationDetails>

public class PrimaryAttributePortletPreAuthenticatedAuthenticationDetailsSource
extends org.jasig.springframework.security.portlet.authentication.PortletPreAuthenticatedAuthenticationDetailsSource

Extention of portlet pre-auth source that captures an attribute out of the portlet USER_INFO map and stores it in the authentication details. The USER_INFO attribute(s) to be checked for a value is configured via portlet preferences, by default the "primaryAttribute" preference is used by this can be changed by setting setPrimaryUserAttributesPreference(String). If multiple attribute names are specified in the preference they are checked in order and the first value returned is used. If no attribute is found an AccessDeniedException is thrown

Author:
Eric Dalquist

Field Summary
 
Fields inherited from class org.jasig.springframework.security.portlet.authentication.PortletPreAuthenticatedAuthenticationDetailsSource
logger, portletMappableRoles, portletUserRoles2GrantedAuthoritiesMapper
 
Constructor Summary
PrimaryAttributePortletPreAuthenticatedAuthenticationDetailsSource()
           
 
Method Summary
 org.jasig.springframework.security.portlet.authentication.PreAuthenticatedGrantedAuthoritiesPortletAuthenticationDetails buildDetails(javax.portlet.PortletRequest context)
           
 String getPrimaryUserAttribute(javax.portlet.PortletRequest request)
          Get the user's primary attribute.
 void setPrimaryUserAttributesPreference(String primaryUserAttributesPreference)
          Portlet preference to get the USER_INFO attribute names from.
 
Methods inherited from class org.jasig.springframework.security.portlet.authentication.PortletPreAuthenticatedAuthenticationDetailsSource
afterPropertiesSet, buildGrantedAuthorities, getUserRoles, setMappableRolesRetriever, setUserRoles2GrantedAuthoritiesMapper
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PrimaryAttributePortletPreAuthenticatedAuthenticationDetailsSource

public PrimaryAttributePortletPreAuthenticatedAuthenticationDetailsSource()
Method Detail

setPrimaryUserAttributesPreference

public void setPrimaryUserAttributesPreference(String primaryUserAttributesPreference)
Portlet preference to get the USER_INFO attribute names from. Defaults to "primaryAttribute"


buildDetails

public org.jasig.springframework.security.portlet.authentication.PreAuthenticatedGrantedAuthoritiesPortletAuthenticationDetails buildDetails(javax.portlet.PortletRequest context)
Specified by:
buildDetails in interface org.springframework.security.authentication.AuthenticationDetailsSource<javax.portlet.PortletRequest,org.jasig.springframework.security.portlet.authentication.PreAuthenticatedGrantedAuthoritiesPortletAuthenticationDetails>
Overrides:
buildDetails in class org.jasig.springframework.security.portlet.authentication.PortletPreAuthenticatedAuthenticationDetailsSource

getPrimaryUserAttribute

public final String getPrimaryUserAttribute(javax.portlet.PortletRequest request)
Get the user's primary attribute.

Parameters:
primaryUserAttributesPreference - The portlet preference that contains a list of user attributes to inspect in order. The first attribute with a value is returned.
Returns:
The primary attribute, will never return null or empty string
Throws:
org.springframework.web.portlet.ModelAndViewDefiningException - If no emplid is found


Copyright © 2013 Jasig. All Rights Reserved.