Forum Discussion
Deep
5 years agoHelper I
How to auto generate embed token using javascript?
I successfully embed a report into my application using javascript. But I have to update embedded token manually every time. Now I want to call rest API from my code so that token update automatical...
TedPattison
5 years agoMicrosoft Employee
In general, it is insecure to generate embed tokens directly from the client. To do so you would need to pass a highly-priveldged access token back to the browser which is big security risk. Instead, create an server-side API for embed token renewal and have code in the browser call this servier-side API. With this design the application secret for your Azure AD application and the highly-priveldged access tokens all remain on the server and are never passed to the browser. Yes, it is more work but it's the only way to maintain a secure application.