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() |
PersonDirectoryPrincipalResolver(boolean returnNullIfNoAttributes,
java.lang.String principalAttributeName) |
PersonDirectoryPrincipalResolver(org.apereo.services.persondir.IPersonAttributeDao attributeRepository) |
PersonDirectoryPrincipalResolver(org.apereo.services.persondir.IPersonAttributeDao attributeRepository,
org.apereo.cas.authentication.principal.PrincipalFactory principalFactory,
boolean returnNullIfNoAttributes,
org.apereo.cas.authentication.handler.PrincipalNameTransformer principalNameTransformer,
java.lang.String principalAttributeName) |
PersonDirectoryPrincipalResolver(org.apereo.services.persondir.IPersonAttributeDao attributeRepository,
org.apereo.cas.authentication.principal.PrincipalFactory principalFactory,
boolean returnNullIfNoAttributes,
java.lang.String principalAttributeName) |
PersonDirectoryPrincipalResolver(org.apereo.services.persondir.IPersonAttributeDao attributeRepository,
java.lang.String principalAttributeName) |
| 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.
|
boolean |
supports(org.apereo.cas.authentication.Credential credential) |
java.lang.String |
toString() |
protected final org.apereo.services.persondir.IPersonAttributeDao attributeRepository
protected final org.apereo.cas.authentication.principal.PrincipalFactory principalFactory
protected final boolean returnNullIfNoAttributes
protected final org.apereo.cas.authentication.handler.PrincipalNameTransformer principalNameTransformer
protected final java.lang.String principalAttributeName
public PersonDirectoryPrincipalResolver()
public PersonDirectoryPrincipalResolver(org.apereo.services.persondir.IPersonAttributeDao attributeRepository,
java.lang.String principalAttributeName)
public PersonDirectoryPrincipalResolver(org.apereo.services.persondir.IPersonAttributeDao attributeRepository)
public PersonDirectoryPrincipalResolver(boolean returnNullIfNoAttributes,
java.lang.String principalAttributeName)
public PersonDirectoryPrincipalResolver(org.apereo.services.persondir.IPersonAttributeDao attributeRepository,
org.apereo.cas.authentication.principal.PrincipalFactory principalFactory,
boolean returnNullIfNoAttributes,
java.lang.String principalAttributeName)
public PersonDirectoryPrincipalResolver(org.apereo.services.persondir.IPersonAttributeDao attributeRepository,
org.apereo.cas.authentication.principal.PrincipalFactory principalFactory,
boolean returnNullIfNoAttributes,
org.apereo.cas.authentication.handler.PrincipalNameTransformer principalNameTransformer,
java.lang.String principalAttributeName)
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.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