Skip to content

telegram-login

Use when implementing Telegram Login — embedding the Login Widget, handling callback or redirect auth flows, or validating login data server-side. Also use when verifying HMAC-SHA256 signatures, checking auth_date freshness, or integrating Telegram identity into an existing auth system.

ModelSource
inheritpack: telegram
ItemValue
Widget version?22 (current)
Auth methodHMAC-SHA256 — bot token as key
Data freshnessReject auth_date older than 86400s (1 day)
Domain setupBotFather /setdomain — exact match required
Docscore.telegram.org/widgets/login
Full Reference

┏━ 🔧 telegram-login ━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ ┃ Telegram Login Widget + auth reference ┃ ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛

ItemValue
Widget version?22 (current)
Auth methodHMAC-SHA256 — bot token as key
Data freshnessReject auth_date older than 86400s (1 day)
Domain setupBotFather /setdomain — exact match required
Docscore.telegram.org/widgets/login
FileContents
reference/widget.mdWidget embedding — callback mode, redirect mode, config attributes, user data shape
reference/validation.mdServer-side validation — HMAC-SHA256 algorithm, Node.js + Python examples, auth_date check, security rules

Usage: Read the reference file matching your current task. Each file has working code examples and inline gotchas.

  • NEVER trust client-side data — always validate the hash server-side before creating a session
  • Always check auth_date — reject logins older than 86400 seconds
  • Bot token is the signing key — never expose it client-side