T - Authentication token typepublic class DefaultCallbackAuthenticator<T extends AuthenticationToken> extends Object implements Authenticator<T>
Authenticator implementation which uses a callback Function to perform the authentication
strategy.Authenticator.MessageAuthenticator| Constructor and Description |
|---|
DefaultCallbackAuthenticator(Class<? extends T> tokenType,
Function<T,Authentication> callback)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
Authentication |
authenticate(T authenticationToken)
Attempts to perform authentication using given
AuthenticationToken. |
Class<? extends T> |
getTokenType()
Get supported
AuthenticationToken type |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreatepublic DefaultCallbackAuthenticator(Class<? extends T> tokenType, Function<T,Authentication> callback)
tokenType - Authentication token type (not null)callback - Authentication function (not null)public Class<? extends T> getTokenType()
AuthenticatorAuthenticationToken typegetTokenType in interface Authenticator<T extends AuthenticationToken>AuthenticationToken typepublic Authentication authenticate(T authenticationToken) throws AuthenticationException
AuthenticatorAuthenticationToken.
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.
authenticate in interface Authenticator<T extends AuthenticationToken>authenticationToken - the authentication request tokenAuthenticationException - Authentication failedDisabledAccountException,
LockedAccountException,
UnknownAccountException,
ExpiredCredentialsException,
InvalidCredentialsException,
UnsupportedTokenException,
UnexpectedAuthenticationExceptionCopyright © 2019 The Holon Platform. All rights reserved.