com.holonplatform.auth

## Interface Authenticator<T extends AuthenticationToken>

- Type Parameters:
    `T` - Support token type
  All Known Subinterfaces:
    JwtAuthenticator, Realm

      public interface Authenticator<T extends AuthenticationToken>

  Authenticator is responsible for authenticating accounts using an `AuthenticationToken`.

  Every Authenticator declares supported `AuthenticationToken` type though `getTokenType()` method.

  Since:
    5.0.0

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface and Description
    --- | ---
    `static interface` | `Authenticator.MessageAuthenticator` Authenticator which support authentication using generic authentication request `Message`s.

  - ### Method Summary

    All Methods Instance Methods Abstract Methods
    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

- - ### Method Detail

    - #### getTokenType

          Class<? extends T> getTokenType()

      Get supported `AuthenticationToken` type
      Returns:
        Supported `AuthenticationToken` type

    - #### authenticate

          Authentication authenticate(T authenticationToken)
                               throws AuthenticationException

      Attempts to perform authentication using given `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.

      Parameters:
        `authenticationToken` - the authentication request token
      Returns:
        the Authentication that represents principal's account and authorization data
      Throws:
        `AuthenticationException` - Authentication failed
      See Also:
        `DisabledAccountException`, `LockedAccountException`, `UnknownAccountException`, `ExpiredCredentialsException`, `InvalidCredentialsException`, `UnsupportedTokenException`, `UnexpectedAuthenticationException`

Copyright © 2017 The Holon Platform. All rights reserved.