juanifioren / django-oidc-provider

OpenID Connect and OAuth2 provider implementation for Djangonauts.
http://django-oidc-provider.readthedocs.org
MIT License
416 stars 239 forks source link

Support ES256 algorithms #379

Closed locnt1195 closed 3 years ago

locnt1195 commented 3 years ago

My project required Openid Connect Provider support ES256 algorithms but i only see HS256 and RS256. Does anyone apply this or know how to support ES256 algorithms when encode id_token. Thank you for reading this.

ariera commented 3 years ago

Doesn't seem to be currently supported, but should be relatively simple to add. The underlying 3rd party library (jwkest) seems to have support for it: https://github.com/IdentityPython/pyjwkest/blob/master/src/jwkest/jws.py#L201

So it may be as simple as adding the required logic here https://github.com/juanifioren/django-oidc-provider/blob/20282904e240ee679af45cfe0036ef596147cbc7/oidc_provider/lib/utils/token.py#L151

You may need to store the keys somewhere in the database, like what is currently being done with RS256, but i'm not familiar with how ES256 works