add jwt
This commit is contained in:
@@ -1,8 +1,17 @@
|
||||
from authlib.jose import JsonWebKey
|
||||
from aws_lambda_powertools.event_handler.api_gateway import Router
|
||||
|
||||
from util import read_file_path
|
||||
|
||||
router = Router()
|
||||
|
||||
|
||||
public_jwk = JsonWebKey.import_key(read_file_path('public.pem'), {'kty': 'RSA'})
|
||||
|
||||
|
||||
@router.get('/.well-known/jwks.json')
|
||||
def jwks():
|
||||
return {}
|
||||
key = public_jwk.as_dict()
|
||||
key['use'] = 'sig'
|
||||
key['kid'] = 'k1'
|
||||
return {'keys': [key]}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from aws_lambda_powertools.event_handler.api_gateway import Router
|
||||
|
||||
from config import ISSUER, JWT_ALGORITHM, OAUTH2_SCOPES_SUPPORTED
|
||||
from config import ISSUER, OAUTH2_SCOPES_SUPPORTED
|
||||
|
||||
router = Router()
|
||||
|
||||
@@ -13,12 +13,12 @@ def openid_configuration():
|
||||
'token_endpoint': f'{ISSUER}/token',
|
||||
'revocation_endpoint': f'{ISSUER}/revoke',
|
||||
'userinfo_endpoint': f'{ISSUER}/userinfo',
|
||||
'jwks_uri': f'{ISSUER}/jwks.json',
|
||||
'jwks_uri': f'{ISSUER}/.well-known/jwks.json',
|
||||
'scopes_supported': OAUTH2_SCOPES_SUPPORTED.split(),
|
||||
'response_types_supported': ['code'],
|
||||
'grant_types_supported': ['authorization_code', 'refresh_token'],
|
||||
'subject_types_supported': ['public'],
|
||||
'id_token_signing_alg_values_supported': [JWT_ALGORITHM],
|
||||
'id_token_signing_alg_values_supported': ['RS256'],
|
||||
'token_endpoint_auth_methods_supported': [
|
||||
'client_secret_basic',
|
||||
'client_secret_post',
|
||||
|
||||
Reference in New Issue
Block a user