diff --git a/plugin/azure_active_directory/src/callback.php b/plugin/azure_active_directory/src/callback.php index 6e59c9c8123..3bc85d443c5 100644 --- a/plugin/azure_active_directory/src/callback.php +++ b/plugin/azure_active_directory/src/callback.php @@ -97,10 +97,9 @@ $azureGroups = $provider->get('me/memberOf', $token); - foreach ($azureGroups as $azureGroup) { - $azureGroupUid = $azureGroup['objectId']; - - foreach ($roleGroups as $userRole => $groupUid) { + foreach ($roleGroups as $userRole => $groupUid) { + foreach ($azureGroups as $azureGroup) { + $azureGroupUid = $azureGroup['objectId']; if ($azureGroupUid === $groupUid) { $roleActions[$userRole]($user);