[英]ASP.NET MVC 4, Windows Authentication and Active Directory
I have two machines: 我有两台机器:
I tried Forms Authentication and it's working fine with this configuration in my web.config: 我尝试了表单身份验证,并且在我的web.config中使用此配置可以正常工作:
<connectionStrings>
<add name="ADConn" connectionString="LDAP://192.168.0.21" />
</connectionStrings>
<membership defaultProvider="ADMembership">
<providers>
<add name="ADMembership"
type="System.Web.Security.ActiveDirectoryMembershipProvider"
connectionStringName="ADConn"
connectionUsername="dominic"
attributeMapUsername="sAMAccountName"
connectionPassword="p@ssw0rd" />
</providers>
</membership>
Now I want to change from Form to Windows Authentication. 现在,我想从窗体更改为Windows身份验证。 My questions are:
我的问题是:
I tried many tutorials today but it's either giving me 403 or it's not accepting my username and password. 我今天尝试了许多教程,但是要么给我403,要么不接受我的用户名和密码。 If you know any complete step-by-step tutorial, please let me know.
如果您知道任何完整的分步教程,请告诉我。
After days of research, it turns out that IIS at least, should be a member of the domain. 经过几天的研究,事实证明,至少IIS应该是该域的成员。 The client does not necessarily be a member of the domain.
客户端不一定是域的成员。
In the Web.Config, all I need to add is: 在Web.Config中,我需要添加的只是:
<authentication mode="Windows" />
<authorization>
<allow users="*"/>
<deny users="?" />
</authorization>
Connection string and membership are not necessary. 连接字符串和成员身份不是必需的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.