Reputation: 3189
I am trying LDAP/Active directory authentication. This code is working perfectly, I can authenticate. My question is - How do I retrieve user information from AD? I want to read firstname, lastname, fullname, email etc from AD for the authenticated user.
Upvotes: 0
Views: 460
Reputation: 11134
In LDAP, users do not authenticate, connections are authenticated. Once the authorization state of the connection has been established (by a successful bind request), code that desires to retrieve information from the directory must transmit a search request to the directory server and then interpret the response.
Search requests must contain a minimum the following parameters:
base
is the base object itself, one
is the base object and
one level below thw base object, sub
is the base object and all entries below the base object.A list of attributes can also be supplied, though many, but not all, LDAP APIs will request all user attributes if none are supplied in the search request.
Upvotes: 1