Package org.apereo.cas.authentication
Interface AuthenticationHandler
- All Superinterfaces:
org.apereo.cas.util.NamedObject,org.springframework.core.Ordered
- All Known Subinterfaces:
PrePostAuthenticationHandler
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface
public interface AuthenticationHandler
extends org.springframework.core.Ordered, org.apereo.cas.util.NamedObject
An authentication handler authenticates a single credential. In many cases credentials are authenticated by
comparison with data in a system of record such as LDAP directory or database.
- Since:
- 4.0.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringAttribute name containing collection of handler names that successfully authenticated credential.Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Method Summary
Modifier and TypeMethodDescriptionauthenticate(Credential credential, Service service) Authenticates the given credential.static AuthenticationHandlerdisabled()Disabled authentication handler.default intgetOrder()default org.apereo.cas.configuration.model.core.authentication.AuthenticationHandlerStatesgetState()Define the state of the authentication handler.default booleansupports(Class<? extends Credential> clazz) Supports credential class.default booleansupports(Credential credential) Determines whether the handler has the capability to authenticate the given credential.Methods inherited from interface org.apereo.cas.util.NamedObject
getName
-
Field Details
-
SUCCESSFUL_AUTHENTICATION_HANDLERS
Attribute name containing collection of handler names that successfully authenticated credential.- See Also:
-
-
Method Details
-
disabled
Disabled authentication handler.- Returns:
- the authentication handler
-
authenticate
AuthenticationHandlerExecutionResult authenticate(Credential credential, Service service) throws Throwable Authenticates the given credential. There are three possible outcomes of this process, and implementers MUST adhere to the following contract:- Success -- return
AuthenticationHandlerExecutionResult - Failure -- throw
GeneralSecurityException - Indeterminate -- throw
PreventedException
- Parameters:
credential- The credential to authenticate.service- the requesting service, if any.- Returns:
- A result object containing metadata about a successful authentication event that includes at a
minimum the name of the handler that authenticated the credential and some credential metadata. The following data
is optional:
Principal- Messages issued by the handler about the credential (e.g. impending password expiration warning)
- Throws:
Throwable- the throwable
- Success -- return
-
supports
Determines whether the handler has the capability to authenticate the given credential. In practical terms, theauthenticate(Credential, Service)method MUST be capable of processing a given credential ifsupportsreturns true on the same credential.- Parameters:
credential- The credential to check.- Returns:
- True if the handler supports the Credential, false otherwise.
-
supports
Supports credential class.- Parameters:
clazz- the clazz- Returns:
- true/false
-
getOrder
default int getOrder()- Specified by:
getOrderin interfaceorg.springframework.core.Ordered
-
getState
default org.apereo.cas.configuration.model.core.authentication.AuthenticationHandlerStates getState()Define the state of the authentication handler.- Returns:
- the state
-