Forum Discussion

Drizzle's avatar
Drizzle
New Member
3 years ago
Solved

Request a power bi rest API got "operation returned an invalid status code 'Unauthorized'"

We have an application allows user to login then load own power bi data via reset API such as "https://api.powerbi.com/v1.0/myorg/dashboards",  some users can request the data successed but some always got "operation returned an invalid status code 'Unauthorized'". Decode the jwt token found that the "scp" field in payload only listed "Capacity.Read.All" if user request failed.  on the contrary, there are lot of permissions listed in "scp" if the jwt token can request the data.

Why are these differences in the same clientid? How can we fix it? 

Thanks.

  • We found out why some users request the power bi data failed via same clientid.

    It seems the root cause is the app not granted the power bi services API permissions when the user first consent. it always apply the old consent event though we've updated the API permissions.

     

    The Azure portal prompt that "You are editing permission(s) to your application, users will have to consent even if they’ve already done so previously." when update the API permissions. but there is another hints "Starting November 9th, 2020 end users will no longer be able to grant consent to newly registered multitenant apps without verified publishers."

     

    Not sure if it has anything to do with it.

1 Reply

  • We found out why some users request the power bi data failed via same clientid.

    It seems the root cause is the app not granted the power bi services API permissions when the user first consent. it always apply the old consent event though we've updated the API permissions.

     

    The Azure portal prompt that "You are editing permission(s) to your application, users will have to consent even if they’ve already done so previously." when update the API permissions. but there is another hints "Starting November 9th, 2020 end users will no longer be able to grant consent to newly registered multitenant apps without verified publishers."

     

    Not sure if it has anything to do with it.