阅读Windows凭据 [英] Reading Windows credentials
问题描述
刚才已经部署了一个ASP.NET应用程序(VB)到本地IIS服务器(code的开发上在同一台机器),我遇到了麻烦读取Windows身份验证的详细信息。
Have just deployed an ASP.NET app (VB) to a local IIS server (the same machine the code was developed on) and I'm having trouble reading the Windows authentication details.
当在调试模式下运行的纯粹,我可以用细 Me.Context.User.Identity.Name
, Request.ServerVariables(AUTH_USER阅读)
或 Request.LogonUserIdentity.Name
,但是当这种运行在IIS中 - 即使我附上Visual Studio中,并在调试模式下运行,前两个给空白结果和第三给人 NT AUTHORITY \\ IUSR
(匿名用户身份)。
When running purely in debug mode I can read them fine using Me.Context.User.Identity.Name
, Request.ServerVariables("Auth_User")
or Request.LogonUserIdentity.Name
, but when this runs in IIS - even if I attach Visual Studio to it and run in debug mode, the first two give blank results and the third gives NT AUTHORITY\IUSR
(the anonymous user identity).
就紧张,我不希望IIS这些细节自动验证,我只需要能在code阅读。
Just to stress, I don't want IIS to authenticate these details automatically, I just need to be able to read them in the code.
我曾尝试启用和禁用IIS中的匿名身份验证和Windows身份验证,但没有任何变化。
I have tried enabling and disabling Anonymous authentication and Windows authentication in IIS but no change.
任何人都可以建议我应该检查什么吗?
Can anyone suggest what else I should check?
感谢您的帮助!
推荐答案
在我看来,你必须禁用匿名身份验证来获得身份信息。
In my opinion you have to disable anonymous authentication to get the identity informations.
这篇关于阅读Windows凭据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!