File tree Expand file tree Collapse file tree
packages/google-auth/google/oauth2 Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -57,6 +57,9 @@ ignore_missing_imports = True
5757[mypy-grpc_status]
5858ignore_missing_imports = True
5959
60+ [mypy-jwt,jwt.*]
61+ ignore_missing_imports = True
62+
6063[mypy-ibis.*]
6164ignore_missing_imports = True
6265
Original file line number Diff line number Diff line change @@ -132,12 +132,15 @@ def verify_token(
132132 Returns:
133133 Mapping[str, Any]: The decoded token.
134134 """
135+ if isinstance (id_token , bytes ):
136+ id_token = id_token .decode ("utf-8" )
137+
135138 certs = _fetch_certs (request , certs_url )
136139
137140 if "keys" in certs :
138141 try :
139- import jwt as jwt_lib # type: ignore
140- from jwt .api_jwk import PyJWKSet # type: ignore
142+ import jwt as jwt_lib
143+ from jwt .api_jwk import PyJWKSet
141144 except ImportError as caught_exc : # pragma: NO COVER
142145 raise ImportError (
143146 "The pyjwt library is not installed, please install the pyjwt package to use the jwk certs format."
You can’t perform that action at this time.
0 commit comments