Class TokenAuthenticationManager

java.lang.Object
ai.yda.framework.channel.rest.spring.security.TokenAuthenticationManager
All Implemented Interfaces:
org.springframework.security.authentication.AuthenticationManager

public class TokenAuthenticationManager extends Object implements org.springframework.security.authentication.AuthenticationManager
Provides mechanism to processes an Authentication request with TokenAuthentication.
Since:
0.1.0
See Also:
  • TokenAuthentication
  • Constructor Details

    • TokenAuthenticationManager

      public TokenAuthenticationManager(String token)
      Constructs a new TokenAuthenticationManager instance with the provided token.
      Parameters:
      token - the token from which the key hash is extracted and stored for authentication purposes.
  • Method Details

    • authenticate

      public org.springframework.security.core.Authentication authenticate(org.springframework.security.core.Authentication authentication) throws org.springframework.security.core.AuthenticationException
      Authenticates the given Authentication request by comparing its credentials with the stored token key hash.
      Specified by:
      authenticate in interface org.springframework.security.authentication.AuthenticationManager
      Parameters:
      authentication - the Authentication request to be processed.
      Returns:
      the authenticated Authentication object if the credentials match the token key hash.
      Throws:
      org.springframework.security.core.AuthenticationException - if the credentials do not match the token key hash.