Ldap dartlang和dartdap库以及到active directory的连接

Ldap dartlang和dartdap库以及到active directory的连接,ldap,dart,Ldap,Dart,我正在为Dart寻找一个好的ldap库,用于连接Microsoft Active Directory。我找到了dartdap,但我似乎无法让它工作。我100%相信我的CN和密码是正确的,因为我可以通过lpap浏览器连接到Active directory 我得到的错误是: 未捕获错误:无效凭据(49)msg=80090308:LDAPPER:DSID-0C09003A9,注释:AcceptSecurityContext错误,数据52e,v1db1 ldap.yaml看起来像这样(地址、密码和用户名

我正在为Dart寻找一个好的ldap库,用于连接Microsoft Active Directory。我找到了dartdap,但我似乎无法让它工作。我100%相信我的CN和密码是正确的,因为我可以通过lpap浏览器连接到Active directory

我得到的错误是: 未捕获错误:无效凭据(49)msg=80090308:LDAPPER:DSID-0C09003A9,注释:AcceptSecurityContext错误,数据52e,v1db1

ldap.yaml看起来像这样(地址、密码和用户名被打乱)

#LDAP配置文件
#如果未指定连接名称,则使用默认值
违约:
港口:389
主持人:xxx.xx.com
bindDN:cn=测试帐户
密码:xxxxxxxx
ldaptest.dart如下所示:

void readDataFromLDAPServer(){
var ldapConfig=新的ldapConfig(“ldap.yaml”,“default”);
var attrs=[“dn”、“cn”、“objectClass”];
var filter=filter.substring(“cn=A*”);
var notFilter=Filter.not(Filter);
ldapConfig.getConnection().then((LDAPConnection ldap){
search(“dc=example,dc=com”,filter,attrs)。
监听((SearchEntry)=>print('Found$entry');
//我们希望找到非A项
search(“dc=example,dc=com”,notFilter,attrs)
.listen((搜索条目){
//打印(“非搜索=${entry}”);
//todo:测试条目。
});
});
}

有什么问题吗?

我正在使用下面的代码成功绑定到Microsoft AD服务器:

  var host = "ip_address";
  var ssl = false; 
  var port = null; 
  var bindDN = "accountname@domain.name";
  var password = "password";

  var connection = new LdapConnection(host: host);
  connection.setProtocol(ssl, port);
  connection.setAuthentication(bindDN, password);

请注意,我的绑定代码与您使用的不同。我还为Dart 2使用了一个_ldap客户端。

也许这是相关的?看见