Active Directory 成员资格提供程序仅适用于管理员
美好的一天,我正在拉扯我的头发.. 我的 Active Directory 会员资格提供程序配置如下:
<system.web>
<membership>
<providers>
<clear/>
<add name="dev"
type="System.Web.Security.ActiveDirectoryMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
connectionStringName="DevTestConnStr"
attributeMapUsername="sAMAccountName"
connectionUsername="dev\Administrator"
connectionPassword="Password"
applicationName="/web"
/>
提供程序已正确实例化,但当我调用此方法时:
var user = Membership.Providers["myDomain"].GetUser("myUser", false);
调用始终返回 null,除了我将 "Administrator" 传递到调用中的情况...我对于如何让它发挥作用已经没有想法了。请帮忙!
Good day, I am pulling my hair on this one..
I have Active Directory Memebership Provider configured like this:
<system.web>
<membership>
<providers>
<clear/>
<add name="dev"
type="System.Web.Security.ActiveDirectoryMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
connectionStringName="DevTestConnStr"
attributeMapUsername="sAMAccountName"
connectionUsername="dev\Administrator"
connectionPassword="Password"
applicationName="/web"
/>
The provider is instantiated correctly but when I call this:
var user = Membership.Providers["myDomain"].GetUser("myUser", false);
the call always returns null, except the case when I pass "Administrator" into the call... I have run out of ideas on how to make it work. Please help!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可能需要查看这篇 MSDN 文章。
从文章中...
另外,这篇文章。
You may want to check this MSDN article.
From the article...
Also, this post.
正如当我已经准备好保释时,我决定将我的 LDAP 连接字符串从: 更改
为
现在按预期工作!
Just as when I was already ready to bail, I decided to change my LDAP connection string from:
to
Now works as expected!