telegram mini app init data authentication
Workflow
- Confirm the business outcome, owner, source data, constraints, and success metric.
- Inspect the project and available account or analytics evidence before proposing changes.
- Use official documentation for current platform behavior and retain source provenance.
- Produce an evidence-backed plan with assumptions, dependencies, and measurable validation.
- Run only read-only diagnostics by default; gate external, paid, production, or publishing actions behind explicit approval.
Domain Focus
validate Telegram Mini App initData on the server, enforce expiry, map identity, and create safe sessions.
Official Sources
https://core.telegram.org/bots/webapps | https://core.telegram.org/bots/api
Guardrails
- Treat initDataUnsafe and browser-provided user identity as untrusted.
- Validate initData on the server, enforce a bounded auth_date lifetime, and never expose bot tokens.
- Require explicit approval for payments, messages, production bot settings, or externally visible launches.