com.holonplatform.spring.security.internal

## Class AuthenticationProviderAdapter<T extends AuthenticationToken,A extends org.springframework.security.core.Authentication>

- java.lang.Object
- - com.holonplatform.spring.security.internal.AuthenticationProviderAdapter<T,A>

- Type Parameters:
    `T` - Authentication token type
    `A` - Spring Security Authentication type
  All Implemented Interfaces:
    org.springframework.security.authentication.AuthenticationProvider

      public class AuthenticationProviderAdapter<T extends AuthenticationToken,A extends org.springframework.security.core.Authentication>
      extends Object
      implements org.springframework.security.authentication.AuthenticationProvider

  Adapter to use an `Authenticator` as a Spring Security `AuthenticationProvider`.
  Since:
    5.1.0

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `AuthenticationProviderAdapter(Authenticator<T> authenticator, Class<A> authenticationType, Function<A,T> converter)` Constructor.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `org.springframework.security.core.Authentication` | `authenticate(org.springframework.security.core.Authentication authentication)`
    `boolean` | `supports(Class<?> authentication)`

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

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

- - ### Constructor Detail

    - #### AuthenticationProviderAdapter

          public AuthenticationProviderAdapter(Authenticator<T> authenticator,
                                               Class<A> authenticationType,
                                               Function<A,T> converter)

      Constructor.
      Parameters:
        `authenticator` - Authenticator (not null)
        `authenticationType` - Supported Spring Security `Authentication` type
        `converter` - Function to convert the Spring Security `Authentication` into the required `AuthenticationToken` type.

  - ### Method Detail

    - #### supports

          public boolean supports(Class<?> authentication)

      Specified by:
        `supports` in interface `org.springframework.security.authentication.AuthenticationProvider`

    - #### authenticate

          public org.springframework.security.core.Authentication authenticate(org.springframework.security.core.Authentication authentication)
                                                                        throws org.springframework.security.core.AuthenticationException

      Specified by:
        `authenticate` in interface `org.springframework.security.authentication.AuthenticationProvider`
      Throws:
        `org.springframework.security.core.AuthenticationException`

Copyright © 2019 The Holon Platform. All rights reserved.