Forum Discussion
lurbanek
3 years agoNew Member
authorisation with user principal to REST API
I have issues with using the REST API with User Principal. Let me share the issue with you. 1. I'm getting the access token from here: https://login.microsoftonline.com/<instance_id>/oauth2/token, ...
Anonymous
3 years agoNot applicable
Hey lurbanek you are app is probably missing the right scopes. As you can see in the documentation (for instance Datasets - Get Dataset - REST API (Power BI Power BI REST APIs) | Microsoft Learn) each request has a required scope. In the example above the required scopes are Dataset.ReadWrite.All or Dataset.Read.All.
You need to set up these scopes for the application you registered in AD (you are already using the client_id and client_secret of this application when requesting a token. If you do not know how to do it, you can follow Step 2 - Register Application, of this guide: Get started with Power BI Embedded - Power BI | Microsoft Learn.
Let me know if this solve your problem 🙂