You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sondre Eikanger Kvalø edited this page Aug 13, 2013
·
1 revision
Using the LdapConfigurationStore
Add LDAP entry either by using its distinguished name or by providing LDAP search parameters:
finalConstrettoConfigurationconfiguration = newConstrettoBuilder()
.createLdapConfigurationStore(initialDirContext)
.addDsn("cn=Kaare Nilsen,dc=constretto,dc=org")
// all attributes in the given entry will be available (ie. configuration key "cn" will have the value \"Kaare Nilsen")
.addDsnWithKey("sidekick", "cn=Jon-Anders Teigen,dc=constretto,dc=org")
// maps LDAP attributes with prefix "sidekick". (ie. "sidekick.cn" will have the value "Jon-Anders Teigen")
.addUsingSearch("dc=constretto,dc=org", "(&(cn=K*)(objectClass=inetOrgPerson))", "uid")
// Adds all LDAP objects matching the query to configuration attributes prefixed with the value of the "uid" attribute// ie. if the uid attribute for "cn=Kaare Nilsen,dc=constretto,dc=org" is "kaare", its "cn" attribute will be available as "kaare.cn"
.done()
.getConfiguration();