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!
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.
- Anonymous7 years agoNot applicable
HI
I am getting a same error Failed to load resource: the server responded with a status of 401 when I try to open dashboard URL in new tab https://app.powerbi.com/dashboardEmbed?dashboardId=100114d8-9c7c-4ae1-b1d5-291603b4f22c&config=eyJjbHVzdGVyVXJsIjoiaHR0cHM6Ly9XQUJJLVVLLVNPVVRILUItUFJJTUFSWS1yZWRpcmVjdC5hbmFseXNpcy53aW5kb3dzLm5ldCJ9
It works fine on localhost sample dashboard app (C# visual studio 2017)
I am also getting this error on console for https://api.powerbi.com/powerbi/metadata/refreshusermetadata
When i open this link it shows message. See the screenshot below :
The dashboard URL should also work on a new tab too because I want to use this link into another website
Please help me, I am trying to find a solution for this now for two days.
Thanks in advance.