com.holonplatform.spring.security

## Interface SpringSecurityAuthenticationToken

- All Superinterfaces:
    AuthenticationToken, CredentialsContainer, Serializable

      public interface SpringSecurityAuthenticationToken
      extends AuthenticationToken

  An `AuthenticationToken` which uses a Spring Security `Authentication` as authentication principal and credentials provider.

  The Spring Security `Authentication` is returned from `AuthenticationToken.getPrincipal()`, the `Authentication.getCredentials()` is returned from `AuthenticationToken.getCredentials()`.

  Since:
    5.1.0

- - ### Nested Class Summary

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

      `AuthenticationToken.AuthenticationTokenResolver<R extends Message>`

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

      `CredentialsContainer.CredentialsMatcher`

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `static SpringSecurityAuthenticationToken` | `account(String accountId, String secret)` Create an account credentials authentican token, using the Spring Security `UsernamePasswordAuthenticationToken` as concrete authentication token.
    `static SpringSecurityAuthenticationToken` | `create(org.springframework.security.core.Authentication authentication)` Create a new authentican token using given Spring Security `Authentication` as concrete authentication token.
    `org.springframework.security.core.Authentication` | `getAuthentication()` Get the Spring Security `Authentication` bound to this token.

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

      `accountCredentials, bearer, getCredentials, getPrincipal, httpBasicResolver, httpBearerResolver`

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

      `defaultMatcher`

- - ### Method Detail

    - #### getAuthentication

          org.springframework.security.core.Authentication getAuthentication()

      Get the Spring Security `Authentication` bound to this token.
      Returns:
        The Spring Security `Authentication` (not null)

    - #### create

          static SpringSecurityAuthenticationToken create(org.springframework.security.core.Authentication authentication)

      Create a new authentican token using given Spring Security `Authentication` as concrete authentication token.
      Parameters:
        `authentication` - Spring Security `Authentication` token (not null)
      Returns:
        A new `SpringSecurityAuthenticationToken`

    - #### account

          static SpringSecurityAuthenticationToken account(String accountId,
                                                           String secret)

      Create an account credentials authentican token, using the Spring Security `UsernamePasswordAuthenticationToken` as concrete authentication token.
      Parameters:
        `accountId` - Account id (username)
        `secret` - Account secret (password)
      Returns:
        A new `SpringSecurityAuthenticationToken` with given account credentials

Copyright © 2019 The Holon Platform. All rights reserved.