Microsoft-authentication-library-for-js: App rendered inside iFrame when renewing token

Created on 21 Nov 2017  路  2Comments  路  Source: AzureAD/microsoft-authentication-library-for-js

Hello,

I use msal to authorize users via Azure AD in my Angular SPA application. After login redirection I call acquireTokenSilent to refresh token. The problem is when token is refreshed inside iFrame I see the copy of real application (screenshot: https://www.dropbox.com/s/s2xenqruos8pl1g/app%20inside%20iframe.png?dl=0). Is it expected behavior?

Most helpful comment

@rohitnarula7176 sorry for the possible dumb question but as an inexperienced web developer I still don't get why the iframe needs to instantiate a copy of the page? This cause all event handlers and associated callbacks hook to window events to be actually invoked for each instance...

All 2 comments

@TLena This is expected behavior if you have set the redirectUri to your app's root page. In msal, we receive the token via a 302 (redirect response) which means you are first redirected to the login.microsoftonline.com page and after entering your credentials, you get redirected back to your redirectUri with the token served in the url fragment. Closing this issue as this is by design. Please reopen if you still have questions.

@rohitnarula7176 sorry for the possible dumb question but as an inexperienced web developer I still don't get why the iframe needs to instantiate a copy of the page? This cause all event handlers and associated callbacks hook to window events to be actually invoked for each instance...

Was this page helpful?
0 / 5 - 0 ratings