Better error management in jwks token validation
This commit is contained in:
parent
dfadcc52ef
commit
6c99e76c9a
|
@ -331,8 +331,9 @@ class Ping(Resource):
|
||||||
)
|
)
|
||||||
|
|
||||||
jwks_url = current_app.config.get('PING_JWKS_URL')
|
jwks_url = current_app.config.get('PING_JWKS_URL')
|
||||||
validate_id_token(id_token, args['clientId'], jwks_url)
|
result = validate_id_token(id_token, args['clientId'], jwks_url)
|
||||||
|
if result:
|
||||||
|
return result
|
||||||
user, profile = retrieve_user(user_api_url, access_token)
|
user, profile = retrieve_user(user_api_url, access_token)
|
||||||
roles = create_user_roles(profile)
|
roles = create_user_roles(profile)
|
||||||
update_user(user, profile, roles)
|
update_user(user, profile, roles)
|
||||||
|
@ -380,7 +381,9 @@ class OAuth2(Resource):
|
||||||
)
|
)
|
||||||
|
|
||||||
jwks_url = current_app.config.get('PING_JWKS_URL')
|
jwks_url = current_app.config.get('PING_JWKS_URL')
|
||||||
validate_id_token(id_token, args['clientId'], jwks_url)
|
result = validate_id_token(id_token, args['clientId'], jwks_url)
|
||||||
|
if result:
|
||||||
|
return result
|
||||||
|
|
||||||
user, profile = retrieve_user(user_api_url, access_token)
|
user, profile = retrieve_user(user_api_url, access_token)
|
||||||
roles = create_user_roles(profile)
|
roles = create_user_roles(profile)
|
||||||
|
|
Loading…
Reference in New Issue