com.holonplatform.spring.security.internal

## Class AbstractAuthenticationManagerAuthenticator<T extends AuthenticationToken>

- java.lang.Object
- - com.holonplatform.spring.security.internal.AbstractAuthenticationManagerAuthenticator<T>

- Type Parameters:
    `T` - AuthenticationToken type
  All Implemented Interfaces:
    Authenticator<T>
  Direct Known Subclasses:
    AccountCredentialsAuthenticationManagerAuthenticator, DefaultAuthenticationManagerAuthenticator

      public abstract class AbstractAuthenticationManagerAuthenticator<T extends AuthenticationToken>
      extends Object
      implements Authenticator<T>

  Abstract class for `AuthenticationManager` based `Authenticator`s.
  Since:
    5.1.0

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface com.holonplatform.auth.Authenticator

      `Authenticator.MessageAuthenticator`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AbstractAuthenticationManagerAuthenticator(org.springframework.security.authentication.AuthenticationManager authenticationManager)` Constructor.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Authentication` | `authenticate(T authenticationToken)` Attempts to perform authentication using given `AuthenticationToken`.

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface com.holonplatform.auth.Authenticator

      `create, getTokenType`

- - ### Constructor Detail

    - #### AbstractAuthenticationManagerAuthenticator

          public AbstractAuthenticationManagerAuthenticator(org.springframework.security.authentication.AuthenticationManager authenticationManager)

      Constructor.
      Parameters:
        `authenticationManager` - Spring Security `AuthenticationManager` (not null)

  - ### Method Detail

    - #### authenticate

          public Authentication authenticate(T authenticationToken)
                                      throws AuthenticationException

      Description copied from interface: `Authenticator`
      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.

      Specified by:
        `authenticate` in interface `Authenticator<T extends AuthenticationToken>`
      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 © 2019 The Holon Platform. All rights reserved.