新人询问HTTP/1.1 427 Form Authentication Required 的错误的解决方法,多谢大侠们了~
构造如下的html文件,实现自动登录,服务器回应错误HTTP/1.1 427 Form Authentication Required
是不是服务器要求REFERER字段,还是要求带上cookie什么的?
第二个问题:
下面的红色代码想伪造referer字段,应该加上Response.Write(xmlhttp.responseText);
但是在本地直接运行会报Response未定义,这个怎么办?
代码如下:
<html>
<head>
</head>
<body>
<form name=hpssoauth_form method=post>Loading...............
<input name=hpssopassword type=hidden value=ssodemo>
<input name=hpssousername type=hidden value=ssodemo>
</form>
<script language="javascript" runat="server">
var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
xmlhttp.Open("GET","http://portal.ssodemo.com/form_login.php/",false);
xmlhttp.SetRequestHeader("REFERER","http://www.ssodemo.com/");
xmlhttp.Send();
document.hpssoauth_form.action = "http://portal.ssodemo.com/form_login.php/";
document.hpssoauth_form.submit();
</script>
</body>
</html>