Merge pull request #2773 from jplana/jwks_validation_error_control

Better error management in jwks token validation
This commit is contained in:
Hossein Shafagh 2019-05-08 07:42:35 -07:00 committed by GitHub
commit 9cfdf55d9e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 3 deletions

View File

@ -343,8 +343,9 @@ class Ping(Resource):
)
jwks_url = current_app.config.get('PING_JWKS_URL')
validate_id_token(id_token, args['clientId'], jwks_url)
error_code = validate_id_token(id_token, args['clientId'], jwks_url)
if error_code:
return error_code
user, profile = retrieve_user(user_api_url, access_token)
roles = create_user_roles(profile)
update_user(user, profile, roles)
@ -392,7 +393,9 @@ class OAuth2(Resource):
)
jwks_url = current_app.config.get('PING_JWKS_URL')
validate_id_token(id_token, args['clientId'], jwks_url)
error_code = validate_id_token(id_token, args['clientId'], jwks_url)
if error_code:
return error_code
user, profile = retrieve_user(user_api_url, access_token)
roles = create_user_roles(profile)