public class AccountAuthenticator extends Object implements Authenticator<AccountCredentialsToken>
Authenticator which uses an Account.AccountProvider to load Account data for authentication and a
CredentialsContainer.CredentialsMatcher for credentials validation.
This Authenticator supports AccountCredentialsToken token type.
Authenticator.MessageAuthenticator| Constructor and Description |
|---|
AccountAuthenticator(Account.AccountProvider accountService)
Constructor using default
CredentialsContainer.CredentialsMatcher |
AccountAuthenticator(Account.AccountProvider accountService,
CredentialsContainer.CredentialsMatcher credentialsMatcher)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
Authentication |
authenticate(AccountCredentialsToken authenticationToken)
Attempts to perform authentication using given
AuthenticationToken. |
Account.AccountProvider |
getAccountService()
Account service to load
Account data |
CredentialsContainer.CredentialsMatcher |
getCredentialsMatcher()
CredentialsMatcher to use for AuthenticationToken credentials validation
|
Class<? extends AccountCredentialsToken> |
getTokenType()
Get supported
AuthenticationToken type |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreatepublic AccountAuthenticator(Account.AccountProvider accountService)
CredentialsContainer.CredentialsMatcheraccountService - Account service to load Account data (not null)public AccountAuthenticator(Account.AccountProvider accountService, CredentialsContainer.CredentialsMatcher credentialsMatcher)
accountService - Account service to load Account data (not null)credentialsMatcher - CredentialsMatcher to use for AuthenticationToken credentials validationpublic Account.AccountProvider getAccountService()
Account datapublic CredentialsContainer.CredentialsMatcher getCredentialsMatcher()
public Class<? extends AccountCredentialsToken> getTokenType()
AuthenticatorAuthenticationToken typegetTokenType in interface Authenticator<AccountCredentialsToken>AuthenticationToken typepublic Authentication authenticate(AccountCredentialsToken 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<AccountCredentialsToken>authenticationToken - the authentication request tokenAuthenticationException - Authentication failedDisabledAccountException,
LockedAccountException,
UnknownAccountException,
ExpiredCredentialsException,
InvalidCredentialsException,
UnsupportedTokenException,
UnexpectedAuthenticationExceptionCopyright © 2019 The Holon Platform. All rights reserved.