Missing scopes in token for calling Power BI REST API, sudden issue since Friday 30/6 #10292
Open
1 of 9 tasks
Labels
area:csom/rest/api
Category: SharePoint Client Side Object Model SDK / REST API
sharepoint-developer-support
sharepoint-developer-support
type:bug-confirmed
Confirmed bug, not working as designed / expected.
type:bug-suspected
Suspected bug (not working as designed/expected). See “type:bug-confirmed” for confirmed bugs.
Uh oh!
There was an error while loading. Please reload this page.
Target SharePoint environment
SharePoint Online
What SharePoint development model, framework, SDK or API is this about?
💥 SharePoint Framework
Developer environment
macOS
What browser(s) / client(s) have you tested
Additional environment details
Describe the bug / error
We've been calling the Power BI REST API for about five years using a token retrieved from the web part context's AAD token provider. However, starting around Thursday, May 29 or Friday morning, May 30, the token no longer includes previously granted scopes, resulting in 401 Unauthorized errors on endpoints like
https://api.powerbi.com/v1.0/myorg/groups
.Although the
Workspace.Read.All
permission is granted for thePower BI Service
resource, the generated token no longer includes this scope, which appears to be the cause of the failures.Steps to reproduce
I built a dummy web part to showcase the unexpected behavior. See attached projects below for full reproduction.
Some specifics:
package-solution.json
contains following props:These permissions have been granted after the solution was installed, which can be seen on the service principal:
Token is retrieved using the web part context object:
API is then called using a simple fetch with auth bearer token:
The dummy web part will render something like this:
It shows that:
The full solution, zipped:
SPFx project.zip
The solution package (unzip first):
power-bi-api-401.sppkg.zip
Expected behavior
The Power BI Service token should contain all the scopes that have been granted to the SharePoint service principal.
The text was updated successfully, but these errors were encountered: