Skip to content

Add Telegram sign-in (0.5.2) - #50

Merged
adrianvrj merged 2 commits into
mainfrom
telegram-login
Nov 5, 2026
Merged

adrianvrj merged 2 commits into
mainfrom
telegram-login

Conversation

@adrianvrj

Copy link
Copy Markdown
Contributor

Telegram sign-in, shaped like GitHub's. Publishes @cavos/kit@0.5.2 on merge.

  • getTelegramOAuthUrl() / login('telegram'). The authorize URL is refused unless it is https://oauth.telegram.org/auth with exactly this login's PKCE challenge (S256), nonce <appId>.<loginNonce(secret)>, scope openid profile and response_type=code.
  • Callback: telegram_grant is redeemed in the attested enclave with verify_telegram {code_verifier, login_secret}. The enclave derives the nonce from the secret, so a stolen code is useless without it.
  • The enclave token (iss https://enclave.cavos.xyz/telegram) is wired into login binding, social recovery and providerFromClaims.
  • The modal gets a "Continue with Telegram" button, shown when 'telegram' is in providers.

Needs the recovery enclave release v2 (live) and cavos-web with cavos-labs/cavos#342 and #344 (live). No change to the attestation defaults: release v2 is verified through the signed release bundle.

Tested in production from the local demo with a packed tarball: Telegram login → enclave verification → wallet created. npm test: 545 pass (24 new).

getTelegramOAuthUrl() starts a Telegram OpenID Connect login. The backend builds
the oauth.telegram.org URL, and the kit refuses it unless it carries exactly
this login's PKCE challenge (S256), the nonce <appId>.<loginNonce(secret)>,
the scope `openid profile` and response_type `code`. On the callback, a
telegram_grant is redeemed inside the attested enclave with the job
verify_telegram {code_verifier, login_secret}. The enclave derives the nonce
from the secret, so a stolen code is useless without it. The token it signs
(iss https://enclave.cavos.xyz/telegram) is bound and used like the GitHub one.
The modal gains a "Continue with Telegram" button behind the providers list.
@adrianvrj
adrianvrj merged commit 12b2115 into main Nov 5, 2026
2 checks passed
@adrianvrj
adrianvrj deleted the telegram-login branch November 5, 2026 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant