Skip to content

Commit

Permalink
Merge pull request #20 from MaxBab/fix_auth_decode_token_function
Browse files Browse the repository at this point in the history
[auth] - Fix token decode failure
  • Loading branch information
goldyfruit authored Mar 2, 2024
2 parents 565cfbc + fe5f9ce commit a722812
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 5 additions & 1 deletion ibmcloud_python_sdk/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ def decode_token():
"""
try:
token = get_headers()["Authorization"]
return decode(token.split(" ")[1], verify=False)
return decode(
token.split(" ")[1],
algorithms=["RS256"],
options={"verify_signature": False},
)

except Exception as error:
print("Error decoding token. {}".format(error))
Expand Down
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
PyYAML>=3.12
softlayer==5.8.7
PyJWT==2.4.0
PyJWT==2.8.0
ibm-cos-sdk==2.6.2
botocore>=1.16.9
pymemcache==3.2.0
cryptography==42.0.5

0 comments on commit a722812

Please sign in to comment.