Class ApiTokenAuthenticationProvider

java.lang.Object
org.genesys.blocks.tokenauth.spring.ApiTokenAuthenticationProvider
All Implemented Interfaces:
org.springframework.beans.factory.InitializingBean, org.springframework.core.Ordered, org.springframework.security.authentication.AuthenticationProvider

public class ApiTokenAuthenticationProvider extends Object implements org.springframework.security.authentication.AuthenticationProvider, org.springframework.beans.factory.InitializingBean, org.springframework.core.Ordered
API Token authentication provider
  • Field Summary

    Fields inherited from interface org.springframework.core.Ordered

    HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    org.springframework.security.core.Authentication
    authenticate(org.springframework.security.core.Authentication authentication)
    Authenticate the given PreAuthenticatedAuthenticationToken.
    int
     
    void
    setOrder(int i)
     
    final boolean
    supports(Class<?> authentication)
    Indicate that this provider only supports PreAuthenticatedAuthenticationToken (sub)classes.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ApiTokenAuthenticationProvider

      public ApiTokenAuthenticationProvider()
  • Method Details

    • afterPropertiesSet

      public void afterPropertiesSet() throws Exception
      Specified by:
      afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
      Throws:
      Exception
    • authenticate

      public org.springframework.security.core.Authentication authenticate(org.springframework.security.core.Authentication authentication) throws org.springframework.security.core.AuthenticationException
      Authenticate the given PreAuthenticatedAuthenticationToken.

      If the principal contained in the authentication object is null, the request will be ignored to allow other providers to authenticate it.

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

      public final boolean supports(Class<?> authentication)
      Indicate that this provider only supports PreAuthenticatedAuthenticationToken (sub)classes.
      Specified by:
      supports in interface org.springframework.security.authentication.AuthenticationProvider
    • getOrder

      public int getOrder()
      Specified by:
      getOrder in interface org.springframework.core.Ordered
    • setOrder

      public void setOrder(int i)