Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Internet Explorer Cross Domain Iframe Login

I have a Java web application in domain A (that we control). This application displays another website located in domain B (which we do not control) in an iframe. This external website was recently updated to require users to log on before they can see content. They provided us with a URL that will automatically log our users into their site. This URL works when we navigate directly to it in Internet Explorer (we get automatically logged in etc).

However, apparently there was an update to Internet Explorer so that cross domain communication is not allowed. So now when the login URL is displayed in the iframe, it does not successfully log on (I am guessing its being blocked from creating security cookies).

Also, if we browse to the URL directly and get the security in place, then any iframe elements of the site will not work (I am guessing it is being blocked from accessing security cookies).

Does anyone know of a work around for this? Changing the security level on Internet Explorer is not an option (it is controlled by our company's system administrator). Internet Explorer is also our company standard, so we cannot change that (even though it works fine in Firefox).

like image 664
Snowy Coder Girl Avatar asked Dec 14 '25 12:12

Snowy Coder Girl


2 Answers

When you say "elements of the site will not work" what precisely does that mean?

"Cross-domain" interactions have always been restricted in all browsers. This is called "same-origin-policy" and it's the foundation of web security. The "update" to Internet Explorer you're referring to restricts IE such that a webpage on Domain A can no longer navigate a subframe that is inside a page from Domain B. That restriction has been present in IE for 7+ years and is in all browsers. This restriction is not causing your problem.

This most likely problem here is that the subframe fails to set a P3P header that would permit its cookies to be stored. There are perhaps 30 duplicates on that issue on StackOverflow.

To determine if this is what you're encountering, try this:

  1. In IE, click Tools > Internet Options > Privacy tab.
  2. Set the slider to Accept all
  3. Clear your cookies
  4. Restart the browser and retry the scenario.

If this change solves the problem, then the fix is easy: configure the page which is being framed to specify its cookie policy using a P3P response header.

If this doesn't solve the problem, please update the question with more information that would allow others to reproduce it (e.g. traffic logs, live site URL, etc).

like image 182
EricLaw Avatar answered Dec 17 '25 10:12

EricLaw


It turns out that this was causes by the login site not being on the trusted sites list. Having security add it as a trusted site and pushing that to all company computers solved the issue.

like image 37
Snowy Coder Girl Avatar answered Dec 17 '25 11:12

Snowy Coder Girl



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!