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 Summary
FieldsModifier and TypeFieldDescriptionstatic final StringAttribute repository implementation bean name.static final StringGlobal principal attribute repository implementation bean name.static final StringDefault principal resolver bean name.Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Method Summary
Modifier and TypeMethodDescriptiondefault PersonAttributeDaoGets attribute repository, if any.default intgetOrder()default Principalresolve(Credential credential) Resolves a principal from the given credential using an arbitrary strategy.default Principalresolve(Credential credential, Optional<AuthenticationHandler> handler) Resolves a principal from the given credential using an arbitrary strategy.resolve(Credential credential, Optional<Principal> principal, Optional<AuthenticationHandler> handler, Optional<Service> service) 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.Methods inherited from interface org.apereo.cas.util.NamedObject
getName
-
Field Details
-
BEAN_NAME_PRINCIPAL_RESOLVER
Default principal resolver bean name.- See Also:
-
BEAN_NAME_ATTRIBUTE_REPOSITORY
Attribute repository implementation bean name.- See Also:
-
BEAN_NAME_GLOBAL_PRINCIPAL_ATTRIBUTE_REPOSITORY
Global principal attribute repository implementation bean name.- See Also:
-
-
Method Details
-
resolve
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
Determines whether this instance supports principal resolution from the given credential. This method SHOULD be called prior toresolve(Credential, Optional, Optional, Optional))}.- Parameters:
credential- The credential to check for support.- Returns:
- True if credential is supported, false otherwise.
-
getAttributeRepository
Gets attribute repository, if any.- Returns:
- the attribute repository or null.
- Since:
- 5.1
-
getOrder
default int getOrder()- Specified by:
getOrderin interfaceorg.springframework.core.Ordered
-