public class PersonDirectoryPrincipalResolver
extends java.lang.Object
implements org.apereo.cas.authentication.principal.PrincipalResolver
Principal.getAttributes() are populated by the results of the
query and the principal ID may optionally be set by proving an attribute whose first non-null value is used;
otherwise the credential ID is used for the principal ID.| Modifier and Type | Field and Description |
|---|---|
protected org.apereo.services.persondir.IPersonAttributeDao |
attributeRepository
Repository of principal attributes to be retrieved.
|
protected java.lang.String |
principalAttributeName
Optional principal attribute name.
|
protected org.apereo.cas.authentication.principal.PrincipalFactory |
principalFactory
Factory to create the principal type.
|
protected org.apereo.cas.authentication.handler.PrincipalNameTransformer |
principalNameTransformer
Transform principal name.
|
protected boolean |
returnNullIfNoAttributes
return null if no attributes are found.
|
| Constructor and Description |
|---|
PersonDirectoryPrincipalResolver() |
| Modifier and Type | Method and Description |
|---|---|
protected org.apache.commons.lang3.tuple.Pair<java.lang.String,java.util.Map<java.lang.String,java.lang.Object>> |
convertPersonAttributesToPrincipal(java.lang.String extractedPrincipalId,
java.util.Map<java.lang.String,java.util.List<java.lang.Object>> attributes)
Convert person attributes to principal pair.
|
protected java.lang.String |
extractPrincipalId(org.apereo.cas.authentication.Credential credential,
org.apereo.cas.authentication.principal.Principal currentPrincipal)
Extracts the id of the user from the provided credential.
|
org.apereo.services.persondir.IPersonAttributeDao |
getAttributeRepository() |
org.apereo.cas.authentication.principal.Principal |
resolve(org.apereo.cas.authentication.Credential credential,
org.apereo.cas.authentication.principal.Principal currentPrincipal,
org.apereo.cas.authentication.AuthenticationHandler handler) |
protected java.util.Map<java.lang.String,java.util.List<java.lang.Object>> |
retrievePersonAttributes(java.lang.String principalId,
org.apereo.cas.authentication.Credential credential)
Retrieve person attributes map.
|
void |
setAttributeRepository(org.apereo.services.persondir.IPersonAttributeDao attributeRepository) |
void |
setPrincipalAttributeName(java.lang.String attribute) |
void |
setPrincipalFactory(org.apereo.cas.authentication.principal.PrincipalFactory principalFactory) |
void |
setPrincipalNameTransformer(org.apereo.cas.authentication.handler.PrincipalNameTransformer principalNameTransformer) |
void |
setReturnNullIfNoAttributes(boolean returnNullIfNoAttributes) |
boolean |
supports(org.apereo.cas.authentication.Credential credential) |
java.lang.String |
toString() |
protected org.apereo.services.persondir.IPersonAttributeDao attributeRepository
protected org.apereo.cas.authentication.principal.PrincipalFactory principalFactory
protected boolean returnNullIfNoAttributes
protected org.apereo.cas.authentication.handler.PrincipalNameTransformer principalNameTransformer
protected java.lang.String principalAttributeName
public void setAttributeRepository(org.apereo.services.persondir.IPersonAttributeDao attributeRepository)
public void setReturnNullIfNoAttributes(boolean returnNullIfNoAttributes)
public void setPrincipalAttributeName(java.lang.String attribute)
public void setPrincipalFactory(org.apereo.cas.authentication.principal.PrincipalFactory principalFactory)
public boolean supports(org.apereo.cas.authentication.Credential credential)
supports in interface org.apereo.cas.authentication.principal.PrincipalResolverpublic org.apereo.cas.authentication.principal.Principal resolve(org.apereo.cas.authentication.Credential credential,
org.apereo.cas.authentication.principal.Principal currentPrincipal,
org.apereo.cas.authentication.AuthenticationHandler handler)
resolve in interface org.apereo.cas.authentication.principal.PrincipalResolverprotected org.apache.commons.lang3.tuple.Pair<java.lang.String,java.util.Map<java.lang.String,java.lang.Object>> convertPersonAttributesToPrincipal(java.lang.String extractedPrincipalId,
java.util.Map<java.lang.String,java.util.List<java.lang.Object>> attributes)
extractedPrincipalId - the extracted principal idattributes - the attributesprotected java.util.Map<java.lang.String,java.util.List<java.lang.Object>> retrievePersonAttributes(java.lang.String principalId,
org.apereo.cas.authentication.Credential credential)
principalId - the principal idcredential - the credential whose id we have extracted. This is passed so that implementations
can extract useful bits of authN info such as attributes into the principal.public void setPrincipalNameTransformer(org.apereo.cas.authentication.handler.PrincipalNameTransformer principalNameTransformer)
protected java.lang.String extractPrincipalId(org.apereo.cas.authentication.Credential credential,
org.apereo.cas.authentication.principal.Principal currentPrincipal)
credential - the credential provided by the user.currentPrincipal - the current principalpublic java.lang.String toString()
toString in class java.lang.Objectpublic org.apereo.services.persondir.IPersonAttributeDao getAttributeRepository()
getAttributeRepository in interface org.apereo.cas.authentication.principal.PrincipalResolver