Jump to content
  • 0

Passing Authentication Through Iframes


acslakeland
 Share

Question

I Have 4 Separate data pages that share 1 authentication. my first problem is i cant get the data page to stay logged in while its in an i frame. unfortunately i have it deployed on a mobile app and the only way that it will work is in an i frame. any other deployment method and i get error UNSAFE REDIRECT

My second Problem is that i have cross app login enabled, which works perfectly with URL or html deployment so i know its properly set up, however i can not get it to work in my i frames. I'm sure the problem is in sending the parameters because I've had to switch to string quarry strings  however i cant find a way to pass the password as a parameter. Any Ideas on how to fix it so the customer doesn't have to log in in each window?

 

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 0

<form id="login" target="frame" method="post" action="http://remote.com/login">
<input type="hidden" name="username" value="login" />
<input type="hidden" name="password" value="pass" />
</form>

<iframe id="frame" name="frame"></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 != "http://remote.com/list") {
iframe.src = "http://remote.com/list";
}
}
</script>

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...