![](/img/trans.png)
[英]OWIN/Katana WebAPI using Windows Authentication keeps asking for login/password
[英]Windows authentication keeps asking username password even credentials are correct
我开发了一个允许Windows身份验证的应用程序,并将其托管到实时服务器中。 在我的本地PC中,我可以获得用户名密码。 但是当我从Web(例如websso.mydomain.com)访问时,即使我输入了正确的凭据,它仍会询问凭据。
<authentication mode="Windows">
</authentication>
<authorization>
<deny users="?" />
</authorization>
<identity impersonate="true"/>
我在web.config中添加了以上标签,托管服务器是Windows Server 2008 R2。 我试图从中获取用户名
WindowsIdentity.GetCurrent().Name
Environment.Username
Request.ServerVariables["LOGON_USER"]
Request.ServerVariables["AUTH_USER"]
HttpContext.Current.Request.LogonUserIdentity.Name
是否需要在IIS中进行任何更改或配置Windows身份验证要遵循的任何步骤。
安装的IIS版本是7.5
IIS中的Checkk应用程序池所有者
应该是网络服务
最近,我遇到了类似的问题,请尝试确保Windows用户对服务器上的目录具有读取权限。
websso.mydomain.com看起来像Internet域名,而不是Intranet域名,因为它具有部分。 根据https://support.microsoft.com/zh-CN/help/258063/internet-explorer-may-prompt-you-for-a-password,您应使用不带任何部分的域名(例如, http:// websso / )或将域名添加到客户端浏览器的安全设置
像我在这里所做的那样,尝试更新您的<authorization>
以包括<allow>
元素。
例如
<system.web>
<authentication mode="Windows" />
<authorization>
<allow users="yourdomain\someotheruser" />
<deny users="?" />
</authorization>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.