public interface PrincipalResolver
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.Principal
,
Credential
Modifier and Type | Method and Description |
---|---|
org.apereo.services.persondir.IPersonAttributeDao |
getAttributeRepository()
Gets attribute repository, if any.
|
default Principal |
resolve(Credential credential)
Resolves a principal from the given credential using an arbitrary strategy.
|
default Principal |
resolve(Credential credential,
java.util.Optional<AuthenticationHandler> handler)
Resolves a principal from the given credential using an arbitrary strategy.
|
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.
|
boolean |
supports(Credential credential)
Determines whether this instance supports principal resolution from the given credential.
|
default Principal resolve(Credential credential)
credential
- Source credential.default Principal resolve(Credential credential, java.util.Optional<AuthenticationHandler> handler)
credential
- Source credential.handler
- the authentication handler linked to the resolver. May be null.Principal resolve(Credential credential, java.util.Optional<Principal> principal, java.util.Optional<AuthenticationHandler> handler)
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.boolean supports(Credential credential)
resolve(Credential, Optional, Optional)
)}.credential
- The credential to check for support.org.apereo.services.persondir.IPersonAttributeDao getAttributeRepository()