Interface PrincipalResolver

All Superinterfaces:
org.apereo.cas.util.NamedObject, org.springframework.core.Ordered

public interface PrincipalResolver extends org.springframework.core.Ordered, org.apereo.cas.util.NamedObject
Resolves a Principal from a Credential using an arbitrary strategy. Since a Principal requires an identifier at a minimum, the simplest strategy to produce a principal is to copy Credential.getId() onto Principal.getId(). Resolvers commonly query one or more data sources to obtain attributes such as affiliations, group membership, display name, and email. The data source(s) may also provide an alternate identifier mapped by the credential identifier.
Since:
4.0.0
See Also:
  • Field Details

    • BEAN_NAME_PRINCIPAL_RESOLVER

      static final String BEAN_NAME_PRINCIPAL_RESOLVER
      Default principal resolver bean name.
      See Also:
    • BEAN_NAME_ATTRIBUTE_REPOSITORY

      static final String BEAN_NAME_ATTRIBUTE_REPOSITORY
      Attribute repository implementation bean name.
      See Also:
    • BEAN_NAME_GLOBAL_PRINCIPAL_ATTRIBUTE_REPOSITORY

      static final String BEAN_NAME_GLOBAL_PRINCIPAL_ATTRIBUTE_REPOSITORY
      Global principal attribute repository implementation bean name.
      See Also:
  • Method Details

    • resolve

      default Principal resolve(Credential credential) throws Throwable
      Resolves a principal from the given credential using an arbitrary strategy. Assumes no principal is already resolved by the authentication subsystem, etc.
      Parameters:
      credential - Source credential.
      Returns:
      the principal
      Throws:
      Throwable - the throwable
    • resolve

      default Principal resolve(Credential credential, Optional<AuthenticationHandler> handler) throws Throwable
      Resolves a principal from the given credential using an arbitrary strategy. Assumes no principal is already resolved by the authentication subsystem, etc.
      Parameters:
      credential - Source credential.
      handler - the authentication handler linked to the resolver. May be null.
      Returns:
      the principal
      Throws:
      Throwable - the throwable
    • resolve

      Principal resolve(Credential credential, Optional<Principal> principal, Optional<AuthenticationHandler> handler, Optional<Service> service) throws Throwable
      Resolves a principal from the given credential using an arbitrary strategy.
      Parameters:
      credential - Source credential.
      principal - A principal that may have been produced during the authentication process. May be null.
      handler - the authentication handler linked to the resolver. May be null.
      service - the service
      Returns:
      Resolved principal, or null if the principal could not be resolved.
      Throws:
      Throwable - the throwable
    • supports

      boolean supports(Credential credential)
      Determines whether this instance supports principal resolution from the given credential. This method SHOULD be called prior to resolve(Credential, Optional, Optional, Optional))}.
      Parameters:
      credential - The credential to check for support.
      Returns:
      True if credential is supported, false otherwise.
    • getAttributeRepository

      default PersonAttributeDao getAttributeRepository()
      Gets attribute repository, if any.
      Returns:
      the attribute repository or null.
      Since:
      5.1
    • getOrder

      default int getOrder()
      Specified by:
      getOrder in interface org.springframework.core.Ordered