Skip to content

Add FirebaseUser.idToken with claims to firebase-auth #107

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

Closed
rocketraman opened this issue Nov 28, 2020 · 2 comments · Fixed by #142
Closed

Add FirebaseUser.idToken with claims to firebase-auth #107

rocketraman opened this issue Nov 28, 2020 · 2 comments · Fixed by #142
Labels
API coverage Request for missing APIs

Comments

@rocketraman
Copy link

rocketraman commented Nov 28, 2020

Library Class Member Platforms
user FirebaseAuth idToken Android, iOS

The current version of idToken returns only the token itself. The underlying library does provide access to the claims present in the token via the claims property on both iOS and Android. It would be nice if there was a way to get those claims without having to parse the token again.

Reference documentation for APIs in question:

Android: https://firebase.google.com/docs/reference/android/com/google/firebase/auth/GetTokenResult#getClaims()

iOS: https://firebase.google.com/docs/reference/swift/firebaseauth/api/reference/Classes/AuthTokenResult#claims

Note that both platforms provide some additional convenience properties as well, such as the auth timestamp, expiration timestamp, issued at timestamp, and sign-in provider. Ideally, all of those would be available, but from my perspective the claims are the most important and any other attribute should be obtainable from the claims.

@rocketraman rocketraman added the API coverage Request for missing APIs label Nov 28, 2020
@nbransby
Copy link
Member

Could you paste in links to the API you are referring to?

@rocketraman
Copy link
Author

Could you paste in links to the API you are referring to?

@nbransby I've updated the original post with the API reference links.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API coverage Request for missing APIs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants