You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Verify token fails with an incorrect audience claim error, for token generated with firebase_admin
Steps to reproduce:
Use python admin SDK to create a token and verify the same token
Traceback (most recent call last):
File "create_token.py", line 28, in <module>
d = auth.verify_id_token(custom_token)
File "/usr/local/lib/python3.6/site-packages/firebase_admin/auth.py", line 98, in verify_id_token
return token_generator.verify_id_token(id_token)
File "/usr/local/lib/python3.6/site-packages/firebase_admin/auth.py", line 272, in verify_id_token
raise ValueError(error_message)
ValueError: Firebase ID token has incorrect "aud" (audience) claim. Expected "[redacted]" but got "https://identitytoolkit.googleapis.com/google.identity.identitytoolkit.v1.IdentityToolkit". Make sure the ID token comes from the same Firebase project as the service account used to authenticate this SDK. See https://firebase.google.com/docs/auth/admin/verify-id-tokens for details on how to retrieve an ID token.
verify_id_token() only accepts "ID tokens". Custom tokens are not ID tokens. The reported behavior is what is expected in this case. In fact we have a test case for this very scenario where the expected result is an error.
See documentation for details on how to obtain ID tokens.
just had this issue today and this explains it all, but I can see the the test case referenced here @hiranya911 or has it been refactored somewhere else?
[READ] Step 1: Are you in the right place?
Yes
[REQUIRED] Step 2: Describe your environment
[REQUIRED] Step 3: Describe the problem
Verify token fails with an incorrect audience claim error, for token generated with firebase_admin
Steps to reproduce:
Relevant Code:
The text was updated successfully, but these errors were encountered: