Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I'm using Power BI Embedded with new Power BI Service (Not Power BI Workspace Collections). And I'm just using the "App owns data" approach for user to embed reports in web browser. We know embedded token has an expiration time. See: https://msdn.microsoft.com/en-us/library/mt784614.aspx
So my question is: Is there a way to set expiration time ?(Power BI Workspace Collections API has this parameter). If not, I'm a single page application, how can I detect the embedded token has expired ?
Sincerely.
Looking forward to your reply.
Hi, any news?
I'm also interested in how to set the expiration time of an embedded token with the "new powerBI", if it's possible.
Regards
I am also interested in setting the lifetime or expiration time of the embed token for testing. Is this possible with teh new API?
Hi @Phineas,
Check to see if the response from RBreuer would help in your scenario:
"
When listening to errors, as in: https://github.com/Microsoft/PowerBI-JavaScript/wiki/Handling-Events#full-list-of-events-and-their-r... you can subscribe to report.on('error', ...) and access the message propery in the error object to detect token expiration.
Once detected, you can use the JS SDK to apply a new token without having to reload the embedded report https://github.com/Microsoft/PowerBI-JavaScript/wiki/Update-Embed-Token
of course, by using 'exp' in your JWT token, you can always set a timer to refresh the token
"
Regards,
Michael
Hi, Michael, Thanks for your reply.
I'll already seen the link you mentionded.
I tested it in my code by adding: "report.on('error',function(){...})", but the function will not be invoked. Instead, a 403 HTTP code will be returned with content "Access token has expired, resubmit with a new access token".
I know the expired time will be returned with embedded token by calling WEB API "GenerateTokenInGroupAsync(...)".
I want to know whether it is possible to change the expiration time. and is it possible to detect this in front-end.
Regards Phineas
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
12 | |
2 | |
2 | |
1 | |
1 |