Skip to content

Commit 374d323

Browse files
committed
add empty accesstoken response
1 parent 802f915 commit 374d323

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

provider_azure.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,9 @@ func (a *AzureProvider) getAzureGroups(groupsURL string, tokenSource oauth2.Toke
178178
if err != nil {
179179
return nil, fmt.Errorf("unable to get token: %s", err)
180180
}
181+
if token.AccessToken == "" {
182+
return nil, errors.New("access token is empty. Cannot call Microsoft Graph API")
183+
}
181184
payload := strings.NewReader("{\"securityEnabledOnly\": false}")
182185
req, err := http.NewRequest("POST", urlParsed.String(), payload)
183186
if err != nil {

0 commit comments

Comments
 (0)