Class ChainingPrincipalResolver
- java.lang.Object
-
- org.apereo.cas.authentication.principal.resolvers.ChainingPrincipalResolver
-
- All Implemented Interfaces:
org.apereo.cas.authentication.principal.PrincipalResolver
public class ChainingPrincipalResolver extends java.lang.Object implements org.apereo.cas.authentication.principal.PrincipalResolverDelegates to one or more principal resolves in series to resolve a principal. The input to first configured resolver is the authenticated credential; for every subsequent resolver, the input is aCredentialwhose ID is the resolved principal ID of the previous resolver.A common use case for this component is resolving a temporary principal ID from an X.509 credential followed by a search (e.g. LDAP, database) for the final principal based on the temporary ID.
- Since:
- 4.0.0
-
-
Constructor Summary
Constructors Constructor Description ChainingPrincipalResolver()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apereo.services.persondir.IPersonAttributeDaogetAttributeRepository()org.apereo.cas.authentication.principal.Principalresolve(org.apereo.cas.authentication.Credential credential, java.util.Optional<org.apereo.cas.authentication.principal.Principal> principal, java.util.Optional<org.apereo.cas.authentication.AuthenticationHandler> handler)Resolves a credential by delegating to each of the configured resolvers in sequence.booleansupports(org.apereo.cas.authentication.Credential credential)Determines whether the credential is supported by this component by delegating to the first configured resolver in the chain.
-
-
-
Method Detail
-
resolve
public org.apereo.cas.authentication.principal.Principal resolve(org.apereo.cas.authentication.Credential credential, java.util.Optional<org.apereo.cas.authentication.principal.Principal> principal, java.util.Optional<org.apereo.cas.authentication.AuthenticationHandler> handler)Resolves a credential by delegating to each of the configured resolvers in sequence. Note that the final principal is taken from the last resolved principal in the chain, yet attributes are merged.- Specified by:
resolvein interfaceorg.apereo.cas.authentication.principal.PrincipalResolver- Parameters:
credential- Authenticated credential.principal- Authenticated principal, if any.- Returns:
- The principal from the last configured resolver in the chain.
-
supports
public boolean supports(org.apereo.cas.authentication.Credential credential)
Determines whether the credential is supported by this component by delegating to the first configured resolver in the chain.- Specified by:
supportsin interfaceorg.apereo.cas.authentication.principal.PrincipalResolver- Parameters:
credential- The credential to check for support.- Returns:
- True if the first configured resolver in the chain supports the credential, false otherwise.
-
getAttributeRepository
public org.apereo.services.persondir.IPersonAttributeDao getAttributeRepository()
- Specified by:
getAttributeRepositoryin interfaceorg.apereo.cas.authentication.principal.PrincipalResolver
-
-