Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Did you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now

Reply
lbarone
Regular Visitor

Aad or Embed Token in javascript

Hello everyone! I developed an application in REACT in which I make an embedded report and I need to solve the issue of the token either Aad (azure active directory) or Embed so that the duration of the same is long or to refresh the token without the need to embed it manually.
I visited this microsoft page which tells you how to refresh the token but in one part it asks you to add the function to get the token which is what I would be needing.
Thank you very much
https://learn.microsoft.com/es-es/javascript/api/overview/powerbi/refresh-token

Translated with www.DeepL.com/Translator (free version)

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @lbarone ,

 

Embed token has its lifetime and it will expire after out of its lifetime.

You may refer to below blogs to learn how to generate embed token and how to extend the token lifetime.

For reference:

Embed Token - Generate Token

Access token setting expiration times

Configurable token lifetimes in the Microsoft identity platform (preview)

If you want to automatically refresh token, you can learn this blog.

https://learn.microsoft.com/en-us/javascript/api/overview/powerbi/refresh-token#automatically-refres...

 

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.

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi @lbarone ,

 

Embed token has its lifetime and it will expire after out of its lifetime.

You may refer to below blogs to learn how to generate embed token and how to extend the token lifetime.

For reference:

Embed Token - Generate Token

Access token setting expiration times

Configurable token lifetimes in the Microsoft identity platform (preview)

If you want to automatically refresh token, you can learn this blog.

https://learn.microsoft.com/en-us/javascript/api/overview/powerbi/refresh-token#automatically-refres...

 

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.

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.