Class ChainingPrincipalResolver

java.lang.Object
org.apereo.cas.authentication.principal.resolvers.ChainingPrincipalResolver
All Implemented Interfaces:
org.apereo.cas.authentication.principal.PrincipalResolver, org.apereo.cas.util.NamedObject, org.springframework.core.Ordered

public class ChainingPrincipalResolver extends Object implements org.apereo.cas.authentication.principal.PrincipalResolver
Delegates 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 a Credential whose 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
  • Field Summary

    Fields inherited from interface org.springframework.core.Ordered

    HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE

    Fields inherited from interface org.apereo.cas.authentication.principal.PrincipalResolver

    BEAN_NAME_ATTRIBUTE_REPOSITORY, BEAN_NAME_GLOBAL_PRINCIPAL_ATTRIBUTE_REPOSITORY, BEAN_NAME_PRINCIPAL_RESOLVER
  • Constructor Summary

    Constructors
    Constructor
    Description
    ChainingPrincipalResolver(org.apereo.cas.authentication.PrincipalElectionStrategy principalElectionStrategy, org.apereo.cas.configuration.CasConfigurationProperties casProperties)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.apereo.cas.authentication.principal.attribute.PersonAttributeDao
     
    org.apereo.cas.authentication.principal.Principal
    resolve(org.apereo.cas.authentication.Credential credential, Optional<org.apereo.cas.authentication.principal.Principal> principal, Optional<org.apereo.cas.authentication.AuthenticationHandler> handler, Optional<org.apereo.cas.authentication.principal.Service> service)
     
    void
    setChain(List<org.apereo.cas.authentication.principal.PrincipalResolver> chain)
    The chain of delegate resolvers that are invoked in order.
    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.
     

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.apereo.cas.util.NamedObject

    getName

    Methods inherited from interface org.apereo.cas.authentication.principal.PrincipalResolver

    getOrder, resolve, resolve
  • Constructor Details

    • ChainingPrincipalResolver

      public ChainingPrincipalResolver(org.apereo.cas.authentication.PrincipalElectionStrategy principalElectionStrategy, org.apereo.cas.configuration.CasConfigurationProperties casProperties)
  • Method Details

    • resolve

      public org.apereo.cas.authentication.principal.Principal resolve(org.apereo.cas.authentication.Credential credential, Optional<org.apereo.cas.authentication.principal.Principal> principal, Optional<org.apereo.cas.authentication.AuthenticationHandler> handler, Optional<org.apereo.cas.authentication.principal.Service> service) throws Throwable
      Specified by:
      resolve in interface org.apereo.cas.authentication.principal.PrincipalResolver
      Throws:
      Throwable
    • 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:
      supports in interface org.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.cas.authentication.principal.attribute.PersonAttributeDao getAttributeRepository()
      Specified by:
      getAttributeRepository in interface org.apereo.cas.authentication.principal.PrincipalResolver
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • setChain

      public void setChain(List<org.apereo.cas.authentication.principal.PrincipalResolver> chain)
      The chain of delegate resolvers that are invoked in order.