ASP.NET Windows 身份验证问题 - 无法让网站接受我的 Windows 用户和密码
我有一个 ASP.NET 网站设置为使用 Windows 身份验证(不确定我是否会再次这样做!)。
如果我使用以下内容,我就可以正常访问该网站。我知道 Windows 身份验证是为网站设置的,并在 IIS 中启用。
<authorization>
<allow users="*"/>
</authorization>
但是,我不希望该网站可供公开访问,因此我使用以下命令向单个用户授予访问权限。我尝试了 3 次,结果被退回,直到出现错误屏幕“401 - 未经授权:由于凭据无效,访问被拒绝”。
显然,第一个问题是 - 用户名、电脑名称是否正确……是的,我已经尝试了所有可能的排列。这在我以前的开发盒上运行良好,而这个新的设置完全相同。
<authorization>
<allow users="PCNAME\MYUSER"/>
<deny users="*"/>
</authorization>
ASP.NET 日志不提供任何见解。
更新:我刚刚从我过去的笔记中看到我以前遇到过这个问题。只要我不在主机上,身份验证就确实有效。
这是为什么呢?我不敢相信我又在这上面浪费了这么多时间......!
I have an ASP.NET web site set up to use windows authentication (not sure if I'll be doing that again!).
If I use the following, I get access to the web site fine. I know that Windows auth is set up for the web site, and enabled in IIS.
<authorization>
<allow users="*"/>
</authorization>
However, I don't want this site to be publicly accessible, so I use the following to grant access to a single user. I just get bounced for 3 attempts until I hit the error screen "401 - Unauthorized: Access is denied due to invalid credentials."
Obviously the first question is - is the username, PC name correct... it is and I have tried every possible permutation. This worked fine on my previous dev box, and this new one is set up exactly the same.
<authorization>
<allow users="PCNAME\MYUSER"/>
<deny users="*"/>
</authorization>
ASP.NET logs don't offer any insight.
UPDATE: I've just seen from my past notes that I have had this issue before. Authentication does actuall work as long as I'm not on the host PC.
Why is this? I can't believe I've wasted so much time on this again.....!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我刚刚从我过去的笔记中看到我以前也遇到过这个问题。只要我不在主机上,身份验证就确实有效。
I've just seen from my past notes that I have had this issue before. Authentication does actuall work as long as I'm not on the host PC.