Repository navigation
feat: native app social sign-in with PKCE code exchange and expo client - #221
Merged
Merged
Conversation
Contributor
|
Thanks for your first pull request. CI will run shortly. If the change touches package source, please add a changeset with |
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Native apps could not complete a social sign-in: the OAuth callback sets a cookie and redirects to a web URL, and a session token must not go in a redirect URL. This adds the RFC 8252 flow with PKCE and wires it into the expo package.
Server (oauth plugin)
New option
mobile: { redirectUris }, off when omitted.GET /auth/oauth/authorize/:provideracceptsmobile_redirect(exact match against the allowlist) and an S256code_challenge. The pending flow is stored as a one-time token and tied to the browser with an HttpOnly cookie.POST /auth/oauth/mobile/exchangetakes{ code, code_verifier }, checks S256, and returns{ data: { token, user, expiresAt } }. A wrong verifier burns the code.?error=. A required second factor arrives as the usual#gate=fragment on the app URI.Expo client
signInWithProvideranduseSocialSignIn. The browser and crypto functions are injected (openAuthSession,randomBytes,sha256), so the package takes no hard dependency on expo-web-browser or expo-crypto.createSecureStoreStorage(SecureStore).appStateoption: the session is re-checked when the app returns to the foreground.Behavior to know about
theauth_one_time_tokensis now created whenever the oauth plugin is registered (before: only with magic link, email OTP or password reset). The exchange codes live there.mobileis set. New exports and options only, so minor bumps for core and expo.Verified
Not verified
expo-web-browserandexpo-cryptosnippets in docs/expo.mdx follow their documented signatures but were not executed.preferEphemeralSession).basePathmounts the OAuth plugin routes under depends on the host app. The docs say it must expose/auth/oauth/....🤖 Generated with Claude Code