IBM / python-sdk-core

The python-sdk-core repository contains core functionality required by Python code generated by the IBM OpenAPI SDK Generator.
Apache License 2.0
20 stars 27 forks source link

Decoding access_token does not work with PyJWT v2.0.0 #88

Closed prince737 closed 3 years ago

prince737 commented 3 years ago

The requirement states PyJWT >=1.7.1, since PyJWT v2.0.0 was released, on a fresh install v2.0.0 is installed which throws the below error image

psschwei commented 3 years ago

Looks like this the line causing the problem: https://github.com/IBM/python-sdk-core/blob/master/ibm_cloud_sdk_core/jwt_token_manager.py#L71

For PyJMT v2.0+, the verify option was moved into the options dictionary, and so the updated code should be:

decoded_response = jwt.decode(self.access_token, options={"verify_signature": False})

I'll open a PR for this shortly.

padamstx commented 3 years ago

This issue has been fixed in a recent version of the package.