自动登录未经过身份验证

时间:2012-06-22 07:06:51

标签: html login web

我有一个用于工业目的的网络应用程序。这是一个现成的商业应用程序。当Web服务器在我自己的计算机上运行时,我可以使用下面的html代码自动成功登录Web应用程序:

<html>

<title>Login Page</title>

<body>

<form id="loginForm" method="post" name='login' action="http://localhost/_common/lvl5/main.jsp?wbs=527&operatorlocale=en" onsubmit="document.getElementById('pass').value = CJMaker.makeString(document.getElementById('pass').value);" >

<input id="nameInput" type="text" value="Administrator" name="name" size="25" maxlength="80" tabindex="1" style="width:175px;">

<input type="password" value="mhoto0606" id="pass" name="pass"  autocomplete="off" size="25" maxlength="80" tabindex="1" style="width:175px;  ">

</form> 

<script>
document.getElementById('loginForm').submit();
</script>

</body>
</html>

但是当我尝试远程连接到Web应用程序时,它会给出错误,例如“登录未经过身份验证”。为此,我使用下面的代码。唯一的区别是“action”属性中指定的地址。这次我使用服务器的ip地址而不是“localhost”

<html>

<title>Login Page</title>

<body>

<form id="loginForm" method="post" name='login' action="http://###.##.##.##/_common/lvl5/main.jsp?wbs=527&operatorlocale=en" onsubmit="document.getElementById('pass').value = CJMaker.makeString(document.getElementById('pass').value);" >

<input id="nameInput" type="text" value="Administrator" name="name" size="25" maxlength="80" tabindex="1" style="width:175px;">

<input type="password" value="mhoto0606" id="pass" name="pass"  autocomplete="off" size="25" maxlength="80" tabindex="1" style="width:175px;  ">

</form> 

<script>
document.getElementById('loginForm').submit();
</script>

</body>
</html>

此网络应用仅适用于Internet Explorer。

我无法想出解决方案。我迫不及待地等待你的建议。

提前致谢。

1 个答案:

答案 0 :(得分:0)

您真的在HTML中存储凭据吗?你在安全方面犯了一大错误。你不应该这样做。我希望你知道你在做什么!

相关问题