[PR #8359] [CLOSED] feat: Add Telegram as social provider #7923

Closed
opened 2026-03-13 13:53:22 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/8359
Author: @khashvin
Created: 3/4/2026
Status: Closed

Base: canaryHead: feat/telegram-oauth


📝 Commits (3)

  • 463c8c1 feat: Add Telegram as social provider
  • b067423 Merge branch 'canary' into feat/telegram-oauth
  • 8630963 update email handling to generate synthetic email from Telegram ID

📊 Changes

5 files changed (+560 additions, -0 deletions)

View changed files

docs/content/docs/authentication/telegram.mdx (+119 -0)
📝 landing/components/sidebar-content.tsx (+18 -0)
📝 packages/better-auth/src/social.test.ts (+267 -0)
📝 packages/core/src/social-providers/index.ts (+3 -0)
packages/core/src/social-providers/telegram.ts (+153 -0)

📄 Description

This PR adds Telegram as additional OAuth provider, enabling users to authenticate with their Telegram accounts.

Changes

  • Telegram can be configured as OAuth provider for login
  • PKCE is supported as it's required by Telegram
  • Configurable scopes: openid, profile, phone, telegram:bot_access
  • Added docs to guide developers on how to set it up
  • Added tests

Fixes #3526


Summary by cubic

Add Telegram as a social login provider with PKCE and optional ID token sign-in (JWKS + nonce). Includes setup docs, a docs sidebar link, and tests.

  • New Features
    • Telegram OAuth with PKCE; default scopes: openid, profile; optional: phone, telegram:bot_access.
    • ID token sign-in verified via Telegram JWKS; can disable via disableIdTokenSignIn or override with verifyIdToken.
    • Profile defaults: name falls back to preferred_username; email is synthetic from Telegram user ID; emailVerified=false; supports mapProfileToUser and extra fields.
    • Docs with setup and examples; added “Telegram” to the docs sidebar.
    • Tests for OAuth + PKCE, JWKS verification, ID token sign-in, and profile mapping.

Written for commit 863096341a. Summary will update on new commits.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/better-auth/better-auth/pull/8359 **Author:** [@khashvin](https://github.com/khashvin) **Created:** 3/4/2026 **Status:** ❌ Closed **Base:** `canary` ← **Head:** `feat/telegram-oauth` --- ### 📝 Commits (3) - [`463c8c1`](https://github.com/better-auth/better-auth/commit/463c8c16da6cdd1a67fd6fdc7ec9163fa8116f6d) feat: Add Telegram as social provider - [`b067423`](https://github.com/better-auth/better-auth/commit/b067423acbbb83eca349905d95aa474f0f567953) Merge branch 'canary' into feat/telegram-oauth - [`8630963`](https://github.com/better-auth/better-auth/commit/863096341a21e2386f78106621aeaae5dfb651ba) update email handling to generate synthetic email from Telegram ID ### 📊 Changes **5 files changed** (+560 additions, -0 deletions) <details> <summary>View changed files</summary> ➕ `docs/content/docs/authentication/telegram.mdx` (+119 -0) 📝 `landing/components/sidebar-content.tsx` (+18 -0) 📝 `packages/better-auth/src/social.test.ts` (+267 -0) 📝 `packages/core/src/social-providers/index.ts` (+3 -0) ➕ `packages/core/src/social-providers/telegram.ts` (+153 -0) </details> ### 📄 Description This PR adds Telegram as additional OAuth provider, enabling users to authenticate with their Telegram accounts. **Changes** - Telegram can be configured as OAuth provider for login - PKCE is supported as it's required by Telegram - Configurable scopes: openid, profile, phone, telegram:bot_access - Added docs to guide developers on how to set it up - Added tests Fixes #3526 <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Add Telegram as a social login provider with PKCE and optional ID token sign-in (JWKS + nonce). Includes setup docs, a docs sidebar link, and tests. - **New Features** - Telegram OAuth with PKCE; default scopes: openid, profile; optional: phone, telegram:bot_access. - ID token sign-in verified via Telegram JWKS; can disable via disableIdTokenSignIn or override with verifyIdToken. - Profile defaults: name falls back to preferred_username; email is synthetic from Telegram user ID; emailVerified=false; supports mapProfileToUser and extra fields. - Docs with setup and examples; added “Telegram” to the docs sidebar. - Tests for OAuth + PKCE, JWKS verification, ID token sign-in, and profile mapping. <sup>Written for commit 863096341a21e2386f78106621aeaae5dfb651ba. Summary will update on new commits.</sup> <!-- End of auto-generated description by cubic. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-03-13 13:53:22 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#7923