-
Notifications
You must be signed in to change notification settings - Fork 875
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
getIdTokenResult is not handling properly utf-8 claims due base64 encoding compatibility issue with browsers #4174
Labels
Comments
Thanks for filing this issue! Filed b/175030610 internally for tracking. |
I can reproduce this with Chrome and Auth Emulator too. It doesn't seem to affect only Firefox. I think this has something to do with the JS SDK's base64 decoding and I'll take a look. |
yuchenshi
added a commit
that referenced
this issue
Jan 27, 2021
yuchenshi
added a commit
that referenced
this issue
Jan 28, 2021
Merged
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
[REQUIRED] Describe your environment
[REQUIRED] Describe the problem
The token created with with custom claims by admin.auth().createCustomToken(uid, additionalClaims) are encoded in base64 and getIdTokenResult is decoding it on the client but the base64 decoding causes issues with the UTF-8 encoded strings.
Steps to reproduce:
Authenticate user with a custom token with utf-8 claims:
And on the JS side try to read it with:
As a workaround the encoded role with base64 on the server and decoding it with the following function:
is working properly.
The text was updated successfully, but these errors were encountered: