Forum Discussion
Power Bi REST API - 401 Authorization error when using app secret
- 7 years ago
Hi tripleacoder,
As far as I know, the permissions of Power BI are all based on the users. So an App can't act as a user. Please refer to developer/power-bi-permissions where all the descriptions have "user".
Regarding "Tenant.ReadWrite.All", the documentation above also has a description. Actually, these permissions only can retrieve the profiles rather than data. Please refer to admin/reports_getreportsasadmin.
One simple proof we can see is that even an admin can't access all the App workspaces. The data is the precious asset of a company. I think this is reasonable.
Best Regards,
Dale
Could you try to mention an access level in API request?
https://docs.microsoft.com/en-us/rest/api/power-bi/embedtoken/reports_generatetoken#tokenaccesslevel
Regards,
Ruslan
-------------------------------------------------------------------
Did I answer your question? Mark my post as a solution!
- tripleacoder7 years ago
Helper I
Could you try to mention an access level in API request?
https://docs.microsoft.com/en-us/rest/api/power-bi/embedtoken/reports_generatetoken#tokenaccesslevel
I'm not sure what you mean. The link goes to "Required access level for EmbedToken generation", but I'm not using the Embed Token API.
I get the token using this code:
const string authorityUri = "https://login.microsoftonline.com/" + tenantId; AuthenticationContext authContext = new AuthenticationContext(authorityUri); AuthenticationResult result = null; result = await authContext.AcquireTokenAsync(resourceUri, clientCredential);- Anonymous7 years agoNot applicable
can any power bi pro user register an app for power bi in the below link. I have a user who is power bi admin, and he cant register an app. It throws some error related to access when registering thru this dev.powerbi.com/apps.
https://docs.microsoft.com/en-us/power-bi/developer/register-app
Can u help
- Anonymous7 years agoNot applicable
Most organization have app registrations locked down pretty tight. I am not familiar with that tool for app registration, but I don't imagine it is meant to be a workaround for corporate security restrictions, and I would expect it to fail for most users within most Azure tenants.