Merge branch 'v0.1.x' of https://github.com/juanifioren/django-oidc-provider into v0.2.x
Conflicts: README.rst
This commit is contained in:
commit
5311888520
|
@ -40,7 +40,7 @@ Examples running
|
|||
****************
|
||||
|
||||
* **Example OIDC provider** by Juan Ignacio Fiorentino. (`view site <http://openid.juanifioren.com/>`_)
|
||||
* **BAID** by Government of Buenos Aires City*. (`view site <https://id.buenosaires.gob.ar/>`_)
|
||||
* **BAID** by Government of Buenos Aires City. (`view site <https://id.buenosaires.gob.ar/>`_)
|
||||
|
||||
************
|
||||
Contributing
|
||||
|
|
|
@ -4,6 +4,7 @@ import uuid
|
|||
|
||||
from Crypto.PublicKey.RSA import importKey
|
||||
from django.utils import timezone
|
||||
from hashlib import md5
|
||||
from jwkest.jwk import RSAKey
|
||||
from jwkest.jws import JWS
|
||||
|
||||
|
@ -52,7 +53,8 @@ def encode_id_token(payload):
|
|||
|
||||
Return a hash.
|
||||
"""
|
||||
keys = [ RSAKey(key=importKey(get_rsa_key())) ]
|
||||
key_string = get_rsa_key().encode('utf-8')
|
||||
keys = [ RSAKey(key=importKey(key_string), kid=md5(key_string).hexdigest()) ]
|
||||
_jws = JWS(payload, alg='RS256')
|
||||
_jwt = _jws.sign_compact(keys)
|
||||
|
||||
|
|
Loading…
Reference in a new issue