Class TelegramAuthenticationManager
java.lang.Object
io.github.yvasyliev.forwarder.telegram.bot.security.authentication.TelegramAuthenticationManager
- All Implemented Interfaces:
org.springframework.security.authentication.AuthenticationManager
public class TelegramAuthenticationManager
extends Object
implements org.springframework.security.authentication.AuthenticationManager
Manages authentication for Telegram users.
-
Constructor Summary
ConstructorsConstructorDescriptionTelegramAuthenticationManager(org.springframework.security.authentication.AuthenticationManager authenticationManager) -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.security.core.Authenticationauthenticate(org.springframework.security.core.Authentication authentication) org.springframework.security.core.Authenticationauthenticate(org.telegram.telegrambots.meta.api.objects.User user) Authenticates a Telegram user.
-
Constructor Details
-
TelegramAuthenticationManager
public TelegramAuthenticationManager(org.springframework.security.authentication.AuthenticationManager authenticationManager)
-
-
Method Details
-
authenticate
public org.springframework.security.core.Authentication authenticate(org.telegram.telegrambots.meta.api.objects.User user) Authenticates a Telegram user. If the user is not found, returns an anonymous authentication token.- Parameters:
user- the Telegram user to authenticate- Returns:
- the authentication token
-
authenticate
public org.springframework.security.core.Authentication authenticate(org.springframework.security.core.Authentication authentication) throws org.springframework.security.core.AuthenticationException - Specified by:
authenticatein interfaceorg.springframework.security.authentication.AuthenticationManager- Throws:
org.springframework.security.core.AuthenticationException
-