Forum Discussion
Error 403 "User is not authorized" returned when calling GenerateTokenInGroup Power BI API
Hi pedrosilvacreit ,
Base on your description, it seems like it is authentication error. Could you please check the following info for the further troubleshooting?
1. Did you add API permission 'Dataset.Read.All' and 'Report.Read.All', make sure to grant admin consent for these permissions
2. Did you grant the security group which service principal be added in the Admin or Member role to the workspace?Embed Power BI content in an embedded analytics application with service principal and an application secret
3. Please refer the following links to try to solve the problem:
Solved: Getting 403 when calling power bi rest api from po... - Microsoft Fabric Community
Best Regards
Hello Anonymous!
Thanks for your response.
1. No, I don't have those API permissions added. The documentation I saw said that service principal authentication didn't require API permissions.
2. Yes, I've granted both the service principal and the security groups the Admin role to the workspace.
- Anonymous1 year agoNot applicable
Hi pedrosilvacreit ,
Thanks for your reply. Could you please check the following info?
1. Make sure the client id and client secret fill in correctly, especially for the value of client secret. You can refer the following links to get them
2. Enable the Power BI service admin settings
Enable Embed content in apps
Enable Allow service principals to use Power BI APIs
Permission tokens needed to embed a Power BI app - Power BI | Microsoft Learn
Best Regards