如何解决将登录凭据传递给iframe以进行自动登录
我想为超集创建自动登录页面,这是尝试的方法
<form id="login" target="frame" method="post" action="http://superset.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://superset.com/list") {
iframe.src = "http://superset.com/list";
}
}
</script>
该代码在Firfox中运行正常,但是在chrome或Safri中不起作用,我不知道为什么。
框架打开,即使我尝试手动登录,它也不起作用
我试图从另一个窗口登录,但该浏览器在chrome中工作,但该会话未保存在iframe的浏览器中,即使它适用于Firfox
出什么问题了?
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。