I have:
- Web application with configured Azure authentication (Javascript with adal.js)
- Second application that is embedded into the first one as an iFrame (Javascript)
- Second application must be able to call another WebAPI with Azure Authentication deployed to Azure (possibly to another domain).
Question: is it possible to get an AAD authorization token (from the first (container) app into the second one? If yes, any guides/examples would be greatly appreciated.
We can communicate two windows from local using Window.postMessage method. Below is a simple sample to simulate the process to acquire the token from parent page. You can modify it to verify the domain based on the security consideration:
ContainnerPage1.Html
InnerPage.Html