feat(android): forward nonce to native login for OIDC id token - #494
Merged
darwin-morocho merged 2 commits intoJul 3, 2026
Merged
Conversation
The Android side ignored the nonce argument and always called loginManager.logIn(activity, permissions), so no OIDC AuthenticationToken was requested and ClassicToken.authenticationToken was null on native (non-webOnly) login. When a nonce is provided, build a LoginConfiguration with it so the Facebook Android SDK returns an id token, and read that token from the login result.
|
Mention Blocks like a regular teammate with your question or request: @blocks review this pull request Run |
spydon
marked this pull request as ready for review
July 2, 2026 08:39
5 tasks
spydon
marked this pull request as draft
July 2, 2026 09:16
spydon
force-pushed
the
feat/android-oidc-nonce
branch
from
July 3, 2026 07:39
845c66b to
106fbd2
Compare
spydon
marked this pull request as ready for review
July 3, 2026 07:39
Owner
|
@spydon on it |
Owner
|
@spydon thanks for your PR |
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.
What
On Android, forward the
nonceintoLoginConfigurationand surface the returnedAuthenticationToken(OIDC id token) on the result. iOS already exposes theAuthenticationToken; Android was ignoring it, soClassicToken.authenticationTokenwas always null there.Changes
FacebookAuth.loginreads thenonceargument and, when present, logs in with aLoginConfiguration(permissions, nonce)so the SDK requests an OIDC id token.FacebookLoginResultDelegate.onSuccessextractsloginResult.getAuthenticationToken()and includes it in the response.FlutterFacebookAuthPluginpasses thenonceargument through the method channel.Why
Consumers that verify an OIDC id token (for example Supabase's
signInWithIdToken) need theAuthenticationToken. This makes the Android side able to return it, matching iOS.Note on Android behavior
Facebook's Limited Login (the OIDC id token flow) is documented as iOS-only. On Android, Facebook mints the
AuthenticationTokenonly on a full (first) authorization; repeat native logins return a classic access token with a nullAuthenticationToken, and there is no SDK-side way to force it (see facebook/facebook-android-sdk#1132). So this PR reliably surfaces the id token on iOS and on the first Android authorization, which is all Facebook exposes. It does not, and cannot, guarantee an id token on every Android login. That's a Facebook platform limitation, not something the plugin can work around.