请问您的身份验证解决方案是否优雅且足够安全。
的Web.config
<authentication mode="Forms">
<forms name=".ASPXFORMSDEMO" loginUrl="logon.aspx"
protection="All" path="/" timeout="30" />
</authentication>
<authorization>
<deny users ="?" />
<allow users = "*" />
</authorization>
在Logon.aspx.cs中我有两种方法:
private bool ValidateUser(string userName, string passWord)
private void LoginButton_Click(Object sender, EventArgs e)
在ValidateUser
方法内部,我所做的就是执行SQL查询以检查输入的凭据是否与数据库记录类似。
如果凭据匹配,我想要重定向到名为PrivateRoom.aspx
的页面,请说使用Response.Redirect("PrivateRoom.aspx", true);
你们对这种设计有什么看法?它多么优雅,多么安全?
实际上,我如何保护PrivateRoom.aspx
免受未经授权的访问?说我总是可以http://mysite.com/PrivateRoom.aspx
,它会打开这个页面。
感谢您的回答!!!
答案 0 :(得分:1)
不安全,因为您没有使用requireSSL="true"
,因此Cookie可以无担保地旅行。
relative:Can some hacker steal the cookie from a user and login with that name on a web site?