-
Notifications
You must be signed in to change notification settings - Fork 516
Add Facebook Limited Login Support for iOS #2046
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Pull Request Test Coverage Report for Build 15682490243Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, just make sure you complete writing the test before merging!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅
test won’t be implemented as it might make harder future maintenance e.g if the signing key is rotated by facebook
how to skip nonce check? its now not bad ID token but keep happening nonce mismatch. |
## What kind of change does this PR introduce? nonce matching isn't supported for facebook limited login, skipping it during OIDC login. finalizes #2046
## What kind of change does this PR introduce? This PR adds support for [Facebook Limited Login](https://developers.facebook.com/docs/facebook-login/limited-login/) JWT (iOS only) to the `/token?grant_type=id_token` endpoint. This enables iOS apps using Facebook's Limited Login feature to authenticate with Supabase without requiring web browser redirects. ## What is the current behavior? Currently, the `/token?grant_type=id_token` endpoint does not support Facebook as a provider. When iOS apps using Facebook Limited Login try to authenticate with their JWT, they receive a `Bad ID token` error because Facebook's JWT structure is not recognized by the generic OIDC parser. This is already raised by users in #1522 as well. ## What is the new behavior? - iOS apps can now authenticate using Facebook Limited Login JWT via `signInWithIdToken()` function on the client side - Facebook JWT are properly parsed and validated - End users can authenticate on iOS even if they dont allow tracking ([ATT](https://developer.apple.com/documentation/apptrackingtransparency)) ## Additional context Important: Android Platform Limitations This implementation only supports iOS Facebook Limited Login. Android developers must continue using the standard OAuth flow (`signInWithOAuth()`) with web browser redirects. Why Android is not supported in this PR: 1. Fundamental Token Differences: - iOS: Facebook Limited Login provides self-contained JWT ID tokens that follow OIDC standards - Android: Facebook SDK only provides opaque access tokens (random strings, not JWTs) 2. Validation Requirements: - iOS JW: Can be validated using standard OIDC/JWKS (already handled by our infrastructure) - Android access tokens: Require calling Facebook Graph API for validation 3. Architectural Considerations: - The /token?grant_type=id_token endpoint is designed specifically for OIDC-compliant JWT - Adding Graph API validation for Android access tokens would be out of scope and violate the endpoint's single responsibility - It would essentially make this an "id_token OR access_token" endpoint, which breaks the grant type semantics WIP: Tests in `oidc_test.go` will be added.
## What kind of change does this PR introduce? nonce matching isn't supported for facebook limited login, skipping it during OIDC login. finalizes #2046
What kind of change does this PR introduce?
This PR adds support for Facebook Limited Login JWT (iOS only) to the
/token?grant_type=id_token
endpoint. This enables iOS apps using Facebook's Limited Login feature to authenticate with Supabase without requiring web browser redirects.What is the current behavior?
Currently, the
/token?grant_type=id_token
endpoint does not support Facebook as a provider. When iOS apps using Facebook Limited Login try to authenticate with their JWT, they receive aBad ID token
error because Facebook's JWT structure is not recognized by the generic OIDC parser. This is already raised by users in #1522 as well.What is the new behavior?
signInWithIdToken()
function on the client sideAdditional context
Important: Android Platform Limitations
This implementation only supports iOS Facebook Limited Login. Android developers must continue using the standard OAuth flow (
signInWithOAuth()
) with web browser redirects.Why Android is not supported in this PR: