Telegram Authentication Flow
Telegram login logic includes:
- Embed Telegram login widget in the app/web
- Redirect to Telegram Auth
- Client sends hash-signature
- Server verifies signature
- User is searched/created
- JWT is returned to client
📋 Acceptance Criteria
✅ What to consider:
- Telegram login must verify the signature using Telegram's authentication rules.
- Only users with valid signatures should be authenticated.
- After successful authentication, a JWT token must be generated and returned to the client.
✅ Acceptance Criteria (AC):
-
GIVEN a user initiates Telegram login
-
WHEN the signature received from Telegram is valid
-
THEN the user is authenticated and a JWT token is generated and sent to the client
-
GIVEN the signature is invalid or missing
-
WHEN the backend processes the login attempt
-
THEN authentication fails and no token is issued
-
GIVEN a valid JWT token is issued
-
WHEN the user makes authenticated requests
-
THEN the backend verifies the token and grants access accordingly
Edited by Arina Agafonova