Skip to content

expose the payload on a decoded token to allow access to custom claims #85

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions packages/dart_firebase_admin/lib/src/auth/token_verifier.dart
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@ class DecodedIdToken {
required this.picture,
required this.sub,
required this.uid,
required this.payload,
});

@internal
Expand All @@ -334,6 +335,7 @@ class DecodedIdToken {
picture: map['picture'] as String?,
sub: map['sub']! as String,
uid: map['sub']! as String,
payload: map,
);
}

Expand Down Expand Up @@ -408,11 +410,9 @@ class DecodedIdToken {
/// convenience, and is set as the value of the [`sub`](#sub) property.
String uid;

/**
* Other arbitrary claims included in the ID token.
*/
// TODO allow any key
// [key: string]: any;
/// Allow access to other, custom claims by exposing the original payload
Map<String,Object?> payload;

}

/// User facing token information related to the Firebase ID token.
Expand Down