March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Dear All,
we have difficulty in getting EmbedToken.
1. We can get AccessToken calling https://login.microsoftonline.com/common/oauth2/token with "grant-type:password"
2. Using AccessToken from first step we
POST https://api.powerbi.com/v1.0/myorg/groups/{groupId}/reports/{reportId}/GenerateToken
3. Altough we give all permissions to the user ,We get
4. We logged in to https://learn.microsoft.com/en-us/rest/api/power-bi/embed-token/reports-generate-token-in-group#code...
with the user account that we use to get the AccessToken (first step)
5. We are able to get EmbedToken.
What would be the difference between the AccessTokens getting at the first and the fourth steps?
Any help appreciated
Regards
Dear Rico ,
First of all, Thank you very much for your quick response. As far as I understand you explain the differences between Entra ID Token and Embed Token and how to obtain them.
My question was , we get Entra ID Token (Access Token) by 2 ways with the same master user account. First Way cannot generate Embed Token and the second way does generate, What is missing with first way?
1st Way. Calling Api ( https://login.microsoftonline.com/common/oauth2/token )
2nd Way. Login Api Playground https://learn.microsoft.com/en-us/rest/api/power-bi/embed-token/reports-generate-token-in-group
Copied "Authorization" .
Best Regards,
Hi @uaydogdu ,
I think you can try to call the Power BI API resource url for accress token : "https://analysis.windows.net/powerbi/api".
For reference: Solved: REST API Get Access Token - Microsoft Fabric Community
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Dear Rico ,
We've already call "https://analysis.windows.net/powerbi/api" to get access token.
On application registration we gave full control for the master user to the app.
On our postman response we get Report.Read.All as scope.
Is the "Report.Read.All" enough for getting Embed Token?
What could be the reason we dont see the rest of the scope items in response?
Thank you very much in advance,
Regards
Hi @uaydogdu ,
What would be the difference between the AccessTokens getting at the first and the fourth steps?
Firstly, you will get Entra ID Token (Access Token) by Master User (Account and Password) or Service principal as authentication.
Then you will use this access token to get Embed token in below step.
So they are different.
You may refer to workload and offical blog for more details.
For reference: Permission tokens needed to embed a Power BI app - Power BI | Microsoft Learn
For reference:
Generate an embed token in Power BI embedded analytics - Power BI | Microsoft Learn
As far as I know, here you are using master user (password) as authentication.
I think you need to give permissions as below when you register your Microsoft Entra application.
All of the following, unless a requirement doesn't apply:
allowSaveAs
flag is specified in GenerateTokenRequestFor reference:
Embed content in your Power BI embedded analytics application - Power BI | Microsoft Learn
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
8 | |
2 | |
1 | |
1 | |
1 |
User | Count |
---|---|
10 | |
3 | |
2 | |
2 | |
2 |