ASP.NET Windows 身份验证问题 - 无法让网站接受我的 Windows 用户和密码

发布于 2024-10-02 23:43:14 字数 685 浏览 0 评论 0原文

我有一个 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

如梦亦如幻 2024-10-09 23:43:14

我刚刚从我过去的笔记中看到我以前也遇到过这个问题。只要我不在主机上,身份验证就确实有效。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文