T - Supported token typepublic interface Authenticator<T extends AuthenticationToken>
AuthenticationToken.
Every Authenticator declares supported AuthenticationToken type though getTokenType() method.
| Modifier and Type | Interface and Description |
|---|---|
static interface |
Authenticator.MessageAuthenticator
Authenticator which support authentication using generic authentication request
Messages. |
| Modifier and Type | Method and Description |
|---|---|
Authentication |
authenticate(T authenticationToken)
Attempts to perform authentication using given
AuthenticationToken. |
static <T extends AuthenticationToken> |
create(Class<? extends T> tokenType,
Function<T,Authentication> authenticationFunction)
Create an
Authenticator bound to the given token type and which uses the provided callback
Function to perform the authentication strategy. |
Class<? extends T> |
getTokenType()
Get supported
AuthenticationToken type |
Class<? extends T> getTokenType()
AuthenticationToken typeAuthenticationToken typeAuthentication authenticate(T authenticationToken) throws AuthenticationException
AuthenticationToken.
If the authentication is successful, an Authentication instance is returned that represents the user's
account data and provides authorization operations.
If authentication is not successful, a suitable exception should be thrown. See the specific exceptions listed below for builtin available authentication errors.
authenticationToken - the authentication request tokenAuthenticationException - Authentication failedDisabledAccountException,
LockedAccountException,
UnknownAccountException,
ExpiredCredentialsException,
InvalidCredentialsException,
UnsupportedTokenException,
UnexpectedAuthenticationExceptionstatic <T extends AuthenticationToken> Authenticator<T> create(Class<? extends T> tokenType, Function<T,Authentication> authenticationFunction)
Authenticator bound to the given token type and which uses the provided callback
Function to perform the authentication strategy. See authenticate(AuthenticationToken).T - Authentication token typetokenType - Authentication token type (not null)authenticationFunction - Authentication strategy function (not null)Authenticator instanceCopyright © 2019 The Holon Platform. All rights reserved.