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:
-
Constructor Summary
ConstructorsConstructorDescriptionTokenAuthenticationManager(String token) Constructs a newTokenAuthenticationManagerinstance with the provided token. -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.security.core.Authenticationauthenticate(org.springframework.security.core.Authentication authentication) Authenticates the givenAuthenticationrequest by comparing its credentials with the stored token key hash.
-
Constructor Details
-
TokenAuthenticationManager
Constructs a newTokenAuthenticationManagerinstance 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 givenAuthenticationrequest by comparing its credentials with the stored token key hash.- Specified by:
authenticatein interfaceorg.springframework.security.authentication.AuthenticationManager- Parameters:
authentication- theAuthenticationrequest to be processed.- Returns:
- the authenticated
Authenticationobject if the credentials match the token key hash. - Throws:
org.springframework.security.core.AuthenticationException- if the credentials do not match the token key hash.
-