Using Token auth with Get-SPOSiteUsers , I found that it is using a non-existant variable and failing with the following error:
The audience of the access token (https://xxxxxx.sharepoint.com) is wrong. Should be https://.sharepoint.com!
This is because line 140 in SPO.ps1:
$AccessToken = Get-AccessTokenFromCache -AccessToken $AccessToken -Resource "https://$Tenant.sharepoint.com/" -ClientId "9bc3ab49-b65d-410a-85ad-de819febfddc"
The variable $Tenant do not exists, this bug is corrected writing:
$AccessToken = Get-AccessTokenFromCache -AccessToken $AccessToken -Resource $Site -ClientId "9bc3ab49-b65d-410a-85ad-de819febfddc"
Using Token auth with Get-SPOSiteUsers , I found that it is using a non-existant variable and failing with the following error:
The audience of the access token (https://xxxxxx.sharepoint.com) is wrong. Should be https://.sharepoint.com!
This is because line 140 in SPO.ps1:
$AccessToken = Get-AccessTokenFromCache -AccessToken $AccessToken -Resource "https://$Tenant.sharepoint.com/" -ClientId "9bc3ab49-b65d-410a-85ad-de819febfddc"
The variable $Tenant do not exists, this bug is corrected writing:
$AccessToken = Get-AccessTokenFromCache -AccessToken $AccessToken -Resource $Site -ClientId "9bc3ab49-b65d-410a-85ad-de819febfddc"
(Note that site should be in https://tenant.sharepoint.com format. Thanks for your project.