Merge pull request #1148 from jakedt/jaydoubleyoukay

Fix the JWK to use base64 encoded bytes
This commit is contained in:
Jimmy Zelinskie 2016-01-15 12:13:48 -05:00
commit 838e634dca

View file

@ -1,7 +1,7 @@
import json
import logging
from base64 import urlsafe_b64encode
from jwkest import long_to_base64
from cachetools import lru_cache
from cryptography.x509 import load_pem_x509_certificate
from cryptography.hazmat.backends import default_backend
@ -701,8 +701,8 @@ def jwk_set_uri():
'kty': 'RSA',
'alg': 'RS256',
'use': 'sig',
'n': urlsafe_b64encode(str(certificate.public_numbers().n)),
'e': urlsafe_b64encode(str(certificate.public_numbers().e)),
'n': long_to_base64(certificate.public_numbers().n),
'e': long_to_base64(certificate.public_numbers().e),
}],
'issuer': JWT_ISSUER,
})