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

    Constructors
    Constructor
    Description
    TelegramAuthenticationManager(org.springframework.security.authentication.AuthenticationManager authenticationManager)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.springframework.security.core.Authentication
    authenticate(org.springframework.security.core.Authentication authentication)
     
    org.springframework.security.core.Authentication
    authenticate(org.telegram.telegrambots.meta.api.objects.User user)
    Authenticates a Telegram user.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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:
      authenticate in interface org.springframework.security.authentication.AuthenticationManager
      Throws:
      org.springframework.security.core.AuthenticationException