Showing results for 
Search instead for 
Did you mean: 
New Member

Anybody know how to change and detect Power BI Embedded token expiration.

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: 

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 ?



Looking forward to your reply.



Hi @Phineas,



Check to see if the response from RBreuer would help in your scenario:


When listening to errors, as in: 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

of course, by using 'exp' in your JWT token, you can always set a timer to refresh the token




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

New Member

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.



I am also interested in setting the lifetime or expiration time of the embed token for testing. Is this possible with teh new API?

Helpful resources

Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Community Conference

Microsoft Power Platform Communities

Check out the Winners!


Create an end-to-end data and analytics solution

Learn how Power BI works with the latest Azure data and analytics innovations at the digital event with Microsoft CEO Satya Nadella.