English 中文(简体)
继承的 ASP. NET 代码, 与 AD 连接时不起作用的 OD 连接
原标题:Inherited ASP.NET code that connects to OD not working when connected to AD

我继承了一块软件,它连接到我们的开放目录以提供网络认证。当连接到 OD 时,它就像一个符咒,但我们想过渡到使用活动目录作为我们的主要认证提供者。

显然,在LDAP办法中,这两个人和我已经花了6个小时的时间在翻阅和阅读,但我还是略微超出我的头部。当你试图登录http://cl.ly/Grgo );

例外细节 :

System.DirectoryServices.DirectoryServicesCOMException: An operations error occurred.
[DirectoryServicesCOMException (0x80072020): An operations error occurred.]
LBOX.Membership.LDAPMembershipProvider.ValidateUser(String username, String password) in c:Program FilesCruiseControl.NETserverusers.lbox.comWorkingDirectoryLDAPMembershipProviderLDAPMembershipProvider.cs:59
LBUserService.Login.loginButton_Click(Object sender, EventArgs e) in c:Program FilesCruiseControl.NETserverusers.lbox.comWorkingDirectoryLBUserServiceLogin.aspx.cs:21
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +115
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +140
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +29
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2981

这显然与 LDAPsignshipProvider.cs 和我的 web.config 文件的59行有关。

web.config 文件,来自Cruis Control.net。

<membership defaultProvider="LDAP">
  <providers>
    <add name="LDAP" 
         type="LBOX.Membership.LDAPMembershipProvider" 
         LDAPRoot="LDAP://10.0.1.19:389/cn=administrator,cn=users,dc=office,dc=lbox,dc=com" />
  </providers>
</membership>

LDAP成员 provvider.cs 起第59行

// Attempt to log into the LDAP server as this user
DirectoryEntry root2 = new DirectoryEntry(LDAPRoot, distinctName, password, AuthenticationTypes.ServerBind);
DirectorySearcher searcher2 = new DirectorySearcher(root2);
searcher2.SearchScope = SearchScope.Subtree;
searcher2.Filter = String.Format("cn={0}", username);

我几乎肯定,这与我如何使用 LDAP:// 连接AD有关,我试过,但我无法连接。即使只是猜测,也希望得到任何帮助。我想允许AD认证用户名和密码,而不受约束。

问题回答

在我看来,你 web.config 中的 LDAPROT 路径似乎有点可疑 -- -- 似乎表示实际的“强”用户

LDAPRoot="LDAP://10.0.1.19:389/cn=administrator,cn=users,dc=office,dc=lbox,dc=com"
                               ****************
                               User "administrator" 

但是,这难道不应该是某种“强势”集装箱 < / 强” 吗? 在认证用户时,我想LDAP的会员提供商必须查看在LDAP容器内敲你的数字门的用户,看看他/她是否有效(或不有效)。

您正在创建基于 LDAP root 的目录搜索器, 在用户 中搜索 < em >, 通常不会返回任何结果 。...

我会尽量使用

LDAPRoot="LDAP://10.0.1.19:389/cn=users,dc=office,dc=lbox,dc=com"

这只会在 cn=user 容器内搜索,





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Transaction handling with TransactionScope

I am implementing Transaction using TransactionScope with the help this MSDN article http://msdn.microsoft.com/en-us/library/system.transactions.transactionscope.aspx I just want to confirm that is ...

System.Web.Mvc.Controller Initialize

i have the following base controller... public class BaseController : Controller { protected override void Initialize(System.Web.Routing.RequestContext requestContext) { if (...

Microsoft.Contracts namespace

For what it is necessary Microsoft.Contracts namespace in asp.net? I mean, in what cases I could write using Microsoft.Contracts;?

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签