mirror of
https://pagure.io/fm-orchestrator.git
synced 2026-02-08 07:43:20 +08:00
Handle odd response from OIDC UserInfo.
By surprise, ipsilon handed me back a response with no groups one time. Not sure why. But logging here can hopefully help us catch it next time.
This commit is contained in:
@@ -116,5 +116,11 @@ def get_user(request):
|
||||
log.exception(error)
|
||||
raise Unauthorized(error)
|
||||
|
||||
groups = set(extended_data['groups'])
|
||||
try:
|
||||
groups = set(extended_data['groups'])
|
||||
except Exception as e:
|
||||
error = "Could not find groups in UserInfo from OIDC %s" % str(e)
|
||||
log.exception(extended_data)
|
||||
raise Unauthorized(error)
|
||||
|
||||
return data["username"], groups
|
||||
|
||||
Reference in New Issue
Block a user