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
Try to resolve any valid id_token with certs_url='https://www.googleapis.com/oauth2/v3/certs' --
>>> from google.oauth2 import id_token
>>> id_token._GOOGLE_OAUTH2_CERTS_URL
'https://www.googleapis.com/oauth2/v3/certs'
>>> from google.auth.transport import requests
>>> auth_token = "<valid_token>"
>>> id_token.verify_oauth2_token(auth_token, requests.Request())
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/Cellar/python/3.7.4_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/google/oauth2/id_token.py", line 141, in verify_oauth2_token
id_token, request, audience=audience, certs_url=_GOOGLE_OAUTH2_CERTS_URL
File "/usr/local/Cellar/python/3.7.4_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/google/oauth2/id_token.py", line 123, in verify_token
return jwt.decode(id_token, certs=certs, audience=audience)
File "/usr/local/Cellar/python/3.7.4_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/google/auth/jwt.py", line 226, in decode
raise ValueError("Certificate for key id {} not found.".format(key_id))
ValueError: Certificate for key id 762fa637af953590db8bb8a636bf11d4360abc98 not found.
ifisinstance(certs, Mapping):
key_id=header.get("kid")
ifkey_id:
ifkey_idnotincerts:
raiseValueError("Certificate for key id {} not found.".format(key_id))
certs_to_check= [certs[key_id]]
where it is expecting the structure of the old cert payload:
#444 has reverted this change. and the next release 1.11.2 (#446) will have the previous _GOOGLE_OAUTH2_CERTS_URL. There is discussion in #445 on adding system tests to use the live endpoint.
Steps to reproduce
certs_url='https://www.googleapis.com/oauth2/v3/certs'
--Using the old certs URL works:
It appears that the issue is here:
https://github.com/googleapis/google-auth-library-python/blob/master/google/auth/jwt.py#L222
where it is expecting the structure of the old cert payload:
vs
Looks like this was introduced in #365.
(apologies for the edit -- submitted before I meant to)
The text was updated successfully, but these errors were encountered: