Last updated by marcdexet 7 months ago
LDAP Plugin
The Grails LDAP Plugin uses the Gldapo library to provide an easy to use, object oriented, interface to LDAP enabled directories.Installation
Like any other grails plugin ...grails install-plugin ldap
Documentation
The Gldapo web site contains the current documentation for Gldapo. Please refer to that, but beware that initialization is a little different.Gldapo Initialization with the Grails LDAP Plugin
To configure gldapo for use with your Grails app, you follow the same regular config script initialization process, except that you put the config under the key ldap in your Grails application config. The most common way to do this is to use the grails-app/conf/Config.groovy file ...log4j {
…
}ldap {
directories {
directory1 {
url = "ldap://example.com"
base = "ou=example,dc=com"
userDn = "uid=someuser,ou=example,dc=com"
password = "password"
searchControls {
countLimit = 40
timeLimit = 600
searchScope = "subtree"
}
}
directory2 {
urls = [
"ldap://s1.example2.com",
"ldap://s2.example2.com",
]
base = "ou=example2,dc=com"
}
} schemas = [ # An array of class objects that are the Gldap Schema Classes
my.app.MyGldapoSchemaClass1,
my.app.MyGldapoSchemaClass2
] typemappings = [
my.app.MyTypeMappings
]
}Schema Classes
You can put your schema classes in either grails-app/util or src/groovy. Don't forget to include them in the schemas array in the config!Corrections and bugs
class LdapGrailsPlugin … def watchedResources = ["file:./grails-app/ldap/**.*", "file:./grails-app/conf/*Config.groovy"] //instead of ldap/** wich gives a thread error when grails starts … // modified by goznevi



