Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
HI
I was able to create Embedded Toekn using powerbi create-embed-token Script method using Command Prompt.
I would like to decode this token and validate it. Is there any way of doing it because When I use this token in HTML script.
I am getting error. It says The Content isn't available.
Pls Help
Thanks,
Raj
Solved! Go to Solution.
@vickyprudhvi wrote:
Hi @Eric_Zhang
Thank you for your reply. I am able to validate using below site but wen I use username and role in the token it is throwing error.
Below is the script I am using to generate token. But not working. Any thoughts
var token2 = '{"ver":"0.2.0","wcn":"' + workspaceCollectionName + '","wid": "' + workspaceId + '","rid":"' + reportId + '","iss":"PowerBISDK","aud":"https://analysis.windows.net/powerbi/api","exp":' + exp + ',"nbf":' + nbf + '","roles": "' + roles + '","username": "' + username + '"}'
I'm not sure if that way to concat the token is valid or not, could you share me any documentation explaining that way to generate a token. I'm more used to Microsoft.PowerBI.Api in this demo in github, When role and user name needed, I generate a token this way.
var embedToken = PowerBIToken.CreateReportEmbedToken(this.workspaceCollection, this.workspaceId, report.Id,"username",new string[] { "role1", "role2", "role3" });
@vickyprudhvi wrote:
Hi @Eric_Zhang
As you should have heard regarding new changes with respect to embedding. Now that Azure and PowerBI services are combined. I would like to know how to create embed token with RLS in the new concept. Before we were able to create embed token but today;s world embed token is created in PowerBi Services ( Report ID, Group ID, Aurthentication Code). Is there a way to create embed token in our side. I belive the new embed token is not JWT format.
For the new Embedding with non-Power BI users, I got the confirmation that the RLS is on the roadmap and will be available in next quarter. So you may not apply RLS for the new concept at this moment.
No, it is no longer JWT format, the' embed token is encrypted in the new concept.
@vickyprudhvi wrote:
HI
I was able to create Embedded Toekn using powerbi create-embed-token Script method using Command Prompt.
I would like to decode this token and validate it. Is there any way of doing it because When I use this token in HTML script.
I am getting error. It says The Content isn't available.
Pls Help
Thanks,
Raj
Usually the error "the content isn't available" is due to the token expiration, if the token was generated correctly. You can decode the token following below steps.
By the way, instead of Power BI - CLI(I guess this tool in your case, as you mentioned create-embed-token), you can generate the token every time when embedding in a programming way. Though it is not recommended, you can even generate a token that never expires by changing the official demo code.
var embedToken = PowerBIToken.CreateReportEmbedToken(this.workspaceCollection, this.workspaceId, report.Id,Convert.ToDateTime("2099-12-31"));
Hi @Eric_Zhang
Thank you for your reply. I am able to validate using below site but wen I use username and role in the token it is throwing error.
Below is the script I am using to generate token. But not working. Any thoughts
var token2 = '{"ver":"0.2.0","wcn":"' + workspaceCollectionName + '","wid": "' + workspaceId + '","rid":"' + reportId + '","iss":"PowerBISDK","aud":"https://analysis.windows.net/powerbi/api","exp":' + exp + ',"nbf":' + nbf + '","roles": "' + roles + '","username": "' + username + '"}'
Hello there,
I need to generate a token for embedding power bi report, but i am not using power bi embed for this and I wont be performing authorization.
since its not power bi embed,
var embedToken = PowerBIToken.CreateReportEmbedToken(this.workspaceCollection, this.workspaceId, report.Id,"username",new string[] { "role1", "role2", "role3" });
isnt helping.
how do i go abt this, I got the embed url for the report but a valid access token is a must.
Hi @Eric_Zhang
As you should have heard regarding new changes with respect to embedding. Now that Azure and PowerBI services are combined. I would like to know how to create embed token with RLS in the new concept. Before we were able to create embed token but today;s world embed token is created in PowerBi Services ( Report ID, Group ID, Aurthentication Code). Is there a way to create embed token in our side. I belive the new embed token is not JWT format.
@vickyprudhvi wrote:
Hi @Eric_Zhang
As you should have heard regarding new changes with respect to embedding. Now that Azure and PowerBI services are combined. I would like to know how to create embed token with RLS in the new concept. Before we were able to create embed token but today;s world embed token is created in PowerBi Services ( Report ID, Group ID, Aurthentication Code). Is there a way to create embed token in our side. I belive the new embed token is not JWT format.
For the new Embedding with non-Power BI users, I got the confirmation that the RLS is on the roadmap and will be available in next quarter. So you may not apply RLS for the new concept at this moment.
No, it is no longer JWT format, the' embed token is encrypted in the new concept.
Hi Eric
How to check the claims now?
@vickyprudhvi wrote:
Hi @Eric_Zhang
Thank you for your reply. I am able to validate using below site but wen I use username and role in the token it is throwing error.
Below is the script I am using to generate token. But not working. Any thoughts
var token2 = '{"ver":"0.2.0","wcn":"' + workspaceCollectionName + '","wid": "' + workspaceId + '","rid":"' + reportId + '","iss":"PowerBISDK","aud":"https://analysis.windows.net/powerbi/api","exp":' + exp + ',"nbf":' + nbf + '","roles": "' + roles + '","username": "' + username + '"}'
I'm not sure if that way to concat the token is valid or not, could you share me any documentation explaining that way to generate a token. I'm more used to Microsoft.PowerBI.Api in this demo in github, When role and user name needed, I generate a token this way.
var embedToken = PowerBIToken.CreateReportEmbedToken(this.workspaceCollection, this.workspaceId, report.Id,"username",new string[] { "role1", "role2", "role3" });
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
5 | |
2 | |
1 | |
1 | |
1 |