Interface PrincipalResolver
-
- All Superinterfaces:
org.springframework.core.Ordered
public interface PrincipalResolver extends org.springframework.core.OrderedResolves aPrincipalfrom aCredentialusing an arbitrary strategy. Since aPrincipalrequires an identifier at a minimum, the simplest strategy to produce a principal is to simply copyCredential.getId()ontoPrincipal.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 Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description org.apereo.services.persondir.IPersonAttributeDaogetAttributeRepository()Gets attribute repository, if any.default java.lang.StringgetName()Gets a unique name for this principal resolver.default intgetOrder()default Principalresolve(Credential credential)Resolves a principal from the given credential using an arbitrary strategy.default Principalresolve(Credential credential, java.util.Optional<AuthenticationHandler> handler)Resolves a principal from the given credential using an arbitrary strategy.Principalresolve(Credential credential, java.util.Optional<Principal> principal, java.util.Optional<AuthenticationHandler> handler)Resolves a principal from the given credential using an arbitrary strategy.booleansupports(Credential credential)Determines whether this instance supports principal resolution from the given 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 toresolve(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:
getOrderin interfaceorg.springframework.core.Ordered
-
-