Skip to content
Snippets Groups Projects
Commit 0a89d64e authored by kaiyou's avatar kaiyou
Browse files

Insert kid in jwks

parent 8da4048a
No related branches found
No related tags found
1 merge request!20Add 'remember me' button
Pipeline #1372 passed
......@@ -16,6 +16,7 @@ from hiboo import models, utils, profile, security
import flask
import time
import inspect
import uuid
RSA_KEY_LENGTH = 2048
......@@ -31,9 +32,10 @@ def fill_service(service):
)
if "jwt_public_key" not in service.config:
key, public, _ = generate_rsa_certificate(service.uuid)
kid = {"kid": str(uuid.uuid4())}
service.config.update(
jwt_key=jwk.dumps(key, kty="RSA"),
jwt_public_key=jwk.dumps(public, kty="RSA"),
jwt_key={**kid, **jwk.dumps(key, kty="RSA")},
jwt_public_key={**kid, **jwk.dumps(public, kty="RSA")},
jwt_alg="RS256"
)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment