Merge branch 'master' into jwks_validation_error_control

This commit is contained in:
Hossein Shafagh 2019-05-07 13:09:02 -07:00 committed by GitHub
commit b7ce9ab901
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 7 deletions

View File

@ -132,6 +132,7 @@ def create_user_roles(profile):
roles = [] roles = []
# update their google 'roles' # update their google 'roles'
if 'googleGroups' in profile:
for group in profile['googleGroups']: for group in profile['googleGroups']:
role = role_service.get_by_name(group) role = role_service.get_by_name(group)
if not role: if not role:
@ -139,6 +140,8 @@ def create_user_roles(profile):
if not role.third_party: if not role.third_party:
role = role_service.set_third_party(role.id, third_party_status=True) role = role_service.set_third_party(role.id, third_party_status=True)
roles.append(role) roles.append(role)
else:
current_app.logger.warning("'googleGroups' not sent by identity provider, no specific roles will assigned to the user.")
role = role_service.get_by_name(profile['email']) role = role_service.get_by_name(profile['email'])