RealKinetic / gcp-oidc-proxy

Cloud Function for proxying requests to OIDC-authenticated endpoints
Apache License 2.0
5 stars 8 forks source link

jwt.exceptions.DecodeError: It is required that you pass in a value for the "algorithms" argument when calling decode(). #1

Open SergiiGlad opened 3 years ago

SergiiGlad commented 3 years ago

Hello Tyler, I need your workaround to uptime check App Engine Service behind IAP I run code and get error gcp-oidc-proxytk2idrvyc0m9 Traceback (most recent call last): File "/layers/google.python.pip/pip/lib/python3.8/site-packages/flask/app.py", line 2447, in wsgi_app response = self.full_dispatch_request() File "/layers/google.python.pip/pip/lib/python3.8/site-packages/flask/app.py", line 1952, in full_dispatch_request rv = self.handle_user_exception(e) File "/layers/google.python.pip/pip/lib/python3.8/site-packages/flask/app.py", line 1821, in handle_user_exception reraise(exc_type, exc_value, tb) File "/layers/google.python.pip/pip/lib/python3.8/site-packages/flask/_compat.py", line 39, in reraise raise value File "/layers/google.python.pip/pip/lib/python3.8/site-packages/flask/app.py", line 1950, in full_dispatch_request rv = self.dispatch_request() File "/layers/google.python.pip/pip/lib/python3.8/site-packages/flask/app.py", line 1936, in dispatch_request return self.view_functionsrule.endpoint File "/layers/google.python.pip/pip/lib/python3.8/site-packages/functions_framework/init.py", line 70, in view_func return function(request._get_current_object()) File "/workspace/main.py", line 54, in decorated return f(*args, kwargs) File "/workspace/main.py", line 99, in handle_request _oidc_token = _get_google_oidc_token() File "/workspace/main.py", line 159, in _get_google_oidc_token return OIDCToken(token_response['id_token']) File "/workspace/main.py", line 62, in init self._claims = jwt.decode(token_str, verify=False) File "/layers/google.python.pip/pip/lib/python3.8/site-packages/jwt/api_jwt.py", line 113, in decode decoded = self.decode_complete(jwt, key, algorithms, options, kwargs) File "/layers/google.python.pip/pip/lib/python3.8/site-packages/jwt/api_jwt.py", line 79, in decode_complete raise DecodeError( jwt.exceptions.DecodeError: It is required that you pass in a value for the "algorithms" argument when calling decode().

Could you please help with?

ghost commented 3 years ago

https://github.com/jpadilla/pyjwt/blob/master/CHANGELOG.rst#dropped-deprecated-verify-param-in-jwtdecode

Set the pyjwt to a specific version in the requirements.txt pyjwt==1.7.1