【发布时间】:2014-06-12 20:29:59
【问题描述】:
我正在尝试在我们的 Grails 应用程序中实现 Groovy LDAP (http://directory.apache.org/api/groovy-ldap.html)。
我的代码是
def ldap = new LDAP('ldap://server:389/dc=organization,dc=com', 'cn=Administrator,cn=users,dc=organization,dc=com', 'password')
def results = ldap.search('(objectClass=*)', 'dc=organization,dc=com', SearchScope.ONE )
println " ${results.size} entries found ".center(40,'-')
for (entry in results) {
println entry.dn
}
因此,我总是遇到以下异常:
ERROR errors.GrailsExceptionResolver - NameNotFoundException occurred when processing request: [GET] /app/directory/index
[LDAP: error code 32 - 0000208D: NameErr: DSID-03100213, problem 2001 (NO_OBJECT), data 0, best match of:
'DC=organization,DC=com'
].
如果我使用文档中的读取操作也会发生同样的情况
ldap.read('cn=Administrator,cn=users,dc=organization,dc=com'')
我该如何解决这个问题?
【问题讨论】:
-
2019年找这个库:
@Grapes( @Grab(group='org.xbib.groovy', module='groovy-ldap', version='1.0.2') )
标签: grails groovy active-directory