You're running into what X-Frame-Options
does.
The X-Frame-Options
HTTP response header can be used to indicate whether or not a browser should be allowed to render a page in a <frame>
, <iframe>
, <embed>
or <object>
. Sites can use this to avoid clickjacking attacks, by ensuring that their content is not embedded into other sites.
Source: X-Frame-Options on MDN
If you own the page you're trying to run inside the IFrame, make sure to explicitly set the correct value for the X-Frame-Options
header. If you don't: why display it in an IFrame?
If you're running into Chrome behaving differently than Edge, have a look at how the header is used and if Chrome supports it. For instance, ALLOW-FROM
is not supported by Chrome.
More info: caniuse.com for x-frame-options.
The MDN document I linked to earlier about ALLOW-FROM:
ALLOW-FROM uri (obsolete)
This is an obsolete directive that no longer works in modern browsers. Don't use it. In supporting legacy browsers, a page can only be displayed in a frame on the specified origin uri.
EDIT:
As an addition to your statement
Looks like there is no other option other than removing Azure AD authentication
You should never display any login page in an iframe because of the cickjacking issues it introduces. This is not limited to Azure AD authentication, this is true for any and all authentication options.
Azure AD authentication also has a pop-up option. For instance: if you're using MSAL.js there's this:
You can sign in users to your application in MSAL.js in two ways:
- Pop-up window, by using the loginPopup method
- Redirect, by using the loginRedirect method
Source: Single-page application: Sign-in and Sign-out