Make the user object a dynamic claim set - #30
Merged
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
The native SDKs no longer expose profilePicture or isNewUser on User, so the bridges stop compiling once the native dependencies move to 1.0.2. Claims are configured per deployment, so both bridges now send the claim set as it arrived instead of picking fields out of it, and the Dart User carries those claims, exposes them by key and keeps the well known ones as getters, matching the native SDKs. The native dependency bump comes with it, since the two only make sense together. Signed-off-by: Brion <info@brionmario.com>
brionmario
force-pushed
the
user-claim-set
branch
from
August 24, 2026 09:30
f24e919 to
3c04f4f
Compare
rajithacharith
approved these changes
Aug 24, 2026
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.
Purpose
The iOS and Android SDKs stopped exposing
profilePictureandisNewUseronUserin 1.0.2, and the platform bridges here still read them, so the plugin no longer compiles once the native dependencies are bumped:Underneath the compile error is the reason the native SDKs changed: claims are configured per deployment, so a bridge that names the fields it forwards silently drops every other attribute a tenant configures.
encodeUserwas forwarding six keys, which is why a Flutter app could not read a mobile number or any other configured claim even before this bump.This carries the native dependency bump to 1.0.2 as well, since the two only make sense together. It supersedes #29, which held the bump on its own and could not build without this fix.
Approach
Both bridges now send the claim set as it arrived rather than picking fields out of it. Kotlin returns
user.claimsdirectly. Swift returnsuser.claimswith nestedAnyCodablevalues unwrapped into the types the platform channel codec can encode.Dart
Usermirrors the native shape and the JavaScript SDK'sKnownUser: it holds the claims,operator []reads any of them, andsub,username,email,displayName,givenNameandfamilyNameare getters that read the claim of the same name and nothing else. No fallback chains, no composed values.profileClaimsreturns the claims withreservedClaimsremoved, that set holding only protocol claims:sub,iss,aud,exp,iat,nbf,jti,azp,nonce,typ,at_hash,c_hash,sid,scope,client_id,acr,amrandauth_time.Picture resolution stays in the presentation layer where it already lived, with
picturenow first in the list of claim keysUserAvatarchecks, andUserObjectreading the same claim.android/build.gradle,thunderid_flutter.podspecandPackage.swiftmove to 1.0.2 in the same commit. The bridge changes compile against 1.0.0 as well, so the ordering of the two halves does not matter for bisecting.Related Issues
Related PRs
Checklist
flutter analyzeclean and all tests passing on the bumped dependencies.breaking changelabel added.Security checks