Interface PrincipalResolver

  • All Superinterfaces:
    org.springframework.core.Ordered

    public interface PrincipalResolver
    extends org.springframework.core.Ordered
    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 simply 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:
    Principal, Credential
    • Method Detail

      • resolve

        default Principal resolve​(Credential credential)
        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
      • resolve

        default Principal resolve​(Credential credential,
                                  java.util.Optional<AuthenticationHandler> handler)
        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
      • resolve

        Principal resolve​(Credential credential,
                          java.util.Optional<Principal> principal,
                          java.util.Optional<AuthenticationHandler> handler)
        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.
        Returns:
        Resolved principal, or null if the principal could not be resolved.
      • 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))}.
        Parameters:
        credential - The credential to check for support.
        Returns:
        True if credential is supported, false otherwise.
      • getAttributeRepository

        org.apereo.services.persondir.IPersonAttributeDao getAttributeRepository()
        Gets attribute repository, if any.
        Returns:
        the attribute repository or null.
        Since:
        5.1
      • getName

        default java.lang.String getName()
        Gets a unique name for this principal resolver.
        Returns:
        resolver name.
      • getOrder

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