org.jasig.springframework.security.portlet.authentication
Class PrimaryAttributePortletPreAuthenticatedAuthenticationDetailsSource
java.lang.Object
org.jasig.springframework.security.portlet.authentication.PortletPreAuthenticatedAuthenticationDetailsSource
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
| Fields inherited from class org.jasig.springframework.security.portlet.authentication.PortletPreAuthenticatedAuthenticationDetailsSource |
logger, portletMappableRoles, portletUserRoles2GrantedAuthoritiesMapper |
|
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 |
PrimaryAttributePortletPreAuthenticatedAuthenticationDetailsSource
public PrimaryAttributePortletPreAuthenticatedAuthenticationDetailsSource()
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.