marcospereirampj / python-keycloak

MIT License
692 stars 296 forks source link

error with jwcrypto 1.5.6 #557

Closed damiles closed 3 months ago

damiles commented 3 months ago

There are errors calling to jwcrypto:

File "/usr/local/lib/python3.10/site-packages/keycloak/keycloak_openid.py", line 551, in decode_token
    full_jwt = jwt.JWT(jwt=token, **kwargs)
TypeError: JWT.__init__() got an unexpected keyword argument 'options'
ryshoooo commented 3 months ago

Hi @damiles

From version 4.0.0 we are using jwcrypto instead of jose, so you will need to update your code for the new signatures if you wish to use the python-keycloak version 4 and above for the decode_token function (hence the breaking change release of python-keycloak 4.0.0).

As the error states, options is an unexpected argument for JWT init method, which indeed seems to be the case looking at the documentation of jwcrypto: https://jwcrypto.readthedocs.io/en/latest/jwt.html#jwcrypto.jwt.JWT. I'd recommend reading the jwcrypto's docs and pass along jwtcrypto's available arguments :)

damiles commented 3 months ago

Thanks @ryshoooo for your fast feedback, sorry to don't read the new breaking changes release.