AzureAD: Fallback to no groups if user does not have permission to query groups from azure (#49506) (#49522)
* If GroupMemver.Read.All permissions is not configured return no groups
* fix log
(cherry picked from commit 624f8ef40d)
Co-authored-by: Karl Persson <kalle.persson@grafana.com>
This commit is contained in:
co-authored by
Karl Persson
parent
4dd08e7da6
commit
b8544741aa
@@ -213,7 +213,8 @@ func extractGroups(client *http.Client, claims azureClaims, token *oauth2.Token)
|
||||
|
||||
if res.StatusCode != http.StatusOK {
|
||||
if res.StatusCode == http.StatusForbidden {
|
||||
logger.Error("AzureAD OAuth: failed to fetch user groups. Token need User.Read and GroupMember.Read.All permission")
|
||||
logger.Warn("AzureAD OAuh: Token need GroupMember.Read.All permission to fetch all groups")
|
||||
return []string{}, nil
|
||||
}
|
||||
return nil, errors.New("error fetching groups")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user