I tried to do LDAP authentication using spring security using below configuration. The authentication was successful.
<authentication-manager>
<ldap-authentication-provider
user-search-filter="(uid={0})"
user-search-base="ou=people"
>
</ldap-authentication-provider>
</authentication-manager>
<ldap-server url="ldap://ldap.XXX.net/dc=XXX,dc=com" manager-dn="dc=XXX,dc=com" manager-password="" />
Now I need to get user details like domain ,organization etc from ldap itself,through java I am able to get the results using by calling search method of LdapContext. Is there a similar way to get the details required using spring security after successful authentication?
LdapContext ctx = null;
NamingEnumeration<SearchResult> results = null;
results = ctx.search(baseDn,searchFilter,controls);