Hello,
I have added IFRAME into one of my confluence page. Target URL requires HTTP Basic Authentication so i had to use the following javascript to authenticate the target.
Although https://www.atlassian.com URL works as iframe.src it does not work with my original URL (that URL also belong to me). Both abc.com and atlassian.com are added to whitelist within admin console.
I get "v1.abc.com connection refused message" within iframe window. What could be the reason or how to debug this?
<form id="login" target="frame" method="post" action="https://v2.abc.com/">
<input type="hidden" name="username" value=“XXXX” />
<input type="hidden" name="password" value=“YYYY” />
</form>
<iframe id="frame" name="frame" noborder="0" width="830" height="800" scrolling="yes" seamless></iframe>
<script type="text/javascript">
// submit the form into iframe for login into remote site
document.getElementById('login').submit();
// once you're logged in, change the source url (if needed)
var iframe = document.getElementById('frame');
iframe.onload = function() {
if (iframe.src != "https://www.atlassian.com/") {
// iframe.src="https://v2.abc.com/abc/visual/index.php?service_id=22";
iframe.src="https://www.atlassian.com";
}
}
</script>
Best Regards,
Emre.