com.holonplatform.spring.security.internal

## Class SpringSecurityAuthenticationHolder

- java.lang.Object
- - com.holonplatform.spring.security.internal.SpringSecurityAuthenticationHolder

- All Implemented Interfaces:
    AuthContext.AuthenticationHolder

      public class SpringSecurityAuthenticationHolder
      extends Object
      implements AuthContext.AuthenticationHolder

  An `AuthContext.AuthenticationHolder` using `SecurityContextHolder.getContext()` as Authentication handler.
  Since:
    5.1.0

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `SpringSecurityAuthenticationHolder()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Optional<Authentication>` | `getAuthentication()` Get the current `Authentication`.
    `void` | `setAuthentication(Authentication authentication)` Set the current `Authentication`.

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

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

- - ### Constructor Detail

    - #### SpringSecurityAuthenticationHolder

          public SpringSecurityAuthenticationHolder()

  - ### Method Detail

    - #### getAuthentication

          public Optional<Authentication> getAuthentication()

      Description copied from interface: `AuthContext.AuthenticationHolder`
      Get the current `Authentication`.
      Specified by:
        `getAuthentication` in interface `AuthContext.AuthenticationHolder`
      Returns:
        Optional `Authentication`, empty if not present

    - #### setAuthentication

          public void setAuthentication(Authentication authentication)

      Description copied from interface: `AuthContext.AuthenticationHolder`
      Set the current `Authentication`.
      Specified by:
        `setAuthentication` in interface `AuthContext.AuthenticationHolder`
      Parameters:
        `authentication` - The authentication to set (may be null)

Copyright © 2019 The Holon Platform. All rights reserved.