Class TokenAuthenticationManager

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

public class TokenAuthenticationManager extends Object implements org.springframework.security.authentication.ReactiveAuthenticationManager
Provide mechanism to processes an Authentication request with TokenAuthentication in the reactive manner.
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 reactor.core.publisher.Mono<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.ReactiveAuthenticationManager
      Parameters:
      authentication - the Authentication request to be processed.
      Returns:
      the authenticated reactor.core.publisher.Mono<org.springframework.security.core.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.