casdoor / casdoor-python-sdk

Python client SDK for Casdoor
https://pypi.org/project/casdoor
Apache License 2.0
32 stars 33 forks source link

fix: correct the decryption algorithm to rs256 #15

Closed Steve0x2a closed 2 years ago

Steve0x2a commented 2 years ago

Fix: https://github.com/casdoor/casdoor-python-sdk/issues/8

cert = b'''-----BEGIN CERTIFICATE-----
MIIE+TCCAuGgAwIBAgIDAeJAMA0GCSqGSIb3DQEBCwUAMDYxHTAbBgNVBAoTFENh
...
-----END CERTIFICATE-----'''

sdk = CasdoorSDK(host,client_id,client_secret,cert,org,)
encoded = "eyJhb...."
print(sdk.parse_jwt_token(encoded))
{'owner': 'built-in', 'name': 'admin', 'scope': 'read', 'iss': 'http://localhost:8000', 'sub': '7a6b4a...', 'aud': ['c58c5...'], 'exp': 1648182846, 'nbf': 1647578046, 'iat': 1647578046}

Signed-off-by: Steve0x2a stevesough@gmail.com

casbin-bot commented 2 years ago

@seriouszyx @Abingcbc @ComradeProgrammer please review

hsluoyz commented 2 years ago

@ffyuanda plz review

github-actions[bot] commented 2 years ago

:tada: This PR is included in version 1.1.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket: