[英]“401 - Unauthorized: Access is denied”, when tusers is trying to login to my asp.net intranet web application
I have the following :- 我有以下内容:
My current situation is as follow:- 我目前的情况如下:
So my question is :- 所以我的问题是:
You need to add 2 sets of <providers>
in your web.config, 1 for each domain, as follows. 您需要在web.config中添加2套
<providers>
,每个域1套,如下所示。
1) In the Web.config
file, add connection strings similar to those shown in the following example that point to your Active Directory user database for each domain. 1)在
Web.config
文件中,添加类似于以下示例中所示的连接字符串,该字符串指向每个域的Active Directory用户数据库。
<connectionStrings>
<add name="TestDomain1ConnectionString" connectionString="LDAP://testdomain1.test.com/CN=Users,DC=testdomain1,DC=test,DC=com" />
<add name="TestDomain2ConnectionString" connectionString="LDAP://testdomain2.test.com/CN=Users,DC=testdomain2,DC=test,DC=com" />
.
..
...
</connectionStrings>
2) In the Web.config
file, configure the <membership>
element with ActiveDirectoryMembershipProvider instances pointing to each domain as shown here. 2)在
Web.config
文件中,使用指向每个域的ActiveDirectoryMembershipProvider实例配置<membership>
元素,如下所示。
<membership >
<providers>
<add
name="TestDomain1ADMembershipProvider"
type="System.Web.Security.ActiveDirectoryMembershipProvider, System.Web, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
connectionStringName="TestDomain1ConnectionString"
connectionUsername="testdomain1\administrator"
connectionPassword="password"/>
<add
name="TestDomain2ADMembershipProvider"
type="System.Web.Security.ActiveDirectoryMembershipProvider, System.Web, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
connectionStringName="TestDomain2ConnectionString"
connectionUsername="testdomain2\administrator"
connectionPassword="password"/>
</providers>
</membership>
Make sure you set the connectionStringName
attribute to the correct connection string name specified earlier in your <connectionStrings>
section. 确保将
connectionStringName
属性设置为前面在<connectionStrings>
部分中指定的正确连接字符串名称。
For detailed walkthrough of setting this up and making sure it works, see here. 有关设置并确保其有效的详细演练, 请参见此处。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.