italia / spid-cie-oidc-django

The SPID/CIE OIDC Federation SDK, written in Python
Apache License 2.0
27 stars 28 forks source link

[Fix] The refresh_token is not JWT encoded #154

Closed danielegiallonardo closed 2 years ago

danielegiallonardo commented 2 years ago

When using the offline_access scope, the refresh_token returned by the token endpoint is not JWT encoded, as expected.

It is returned something like this:

{'sub': '28a8c559bc08dd12e7cdf5c4cbc81205197b5fc8a43b0c4597c31c491d8218cd', 'at_hash': 'f3dwV20nEJxJ1RcWm_YvRA', 'c_hash': 'hPRcvWhY45Ani8R7lRAWMQ', 'aud': ['http://127.0.0.1:5000/'], 'iss': 'http://127.0.0.1:8000/oidc/op/', 'jti': 'a5aba0ae-f87f-4df0-83ee-5c4c9552c48c', 'exp': 1647506131, 'iat': 1647504151}

The subsequent call to the revocation endpoint, using the returned refresh_token, fails understandably with error 500.

peppelinux commented 2 years ago

Done here: https://github.com/italia/spid-cie-oidc-django/pull/156