http://www.perlmonks.org?node_id=327894

bodmin has asked for the wisdom of the Perl Monks concerning the following question:

I am able to connect to an ldap directory service, and view data within the directory using Net::LDAP. Fields of particular interest are the username and password. I have access to the username, however there does not appear to be a password field.

I would like to validate a users username and password against an entry in the ldap directory, how do I go about this?.

Any suggestions greatly appreciated.

Replies are listed 'Best First'.
Re: LDAP authentication with Net::LDAP
by inman (Curate) on Feb 10, 2004 at 13:13 UTC
    You need to bind to the directory so that you can test the password. The password is not stored. Only the hash is stored. The hash can only be viewed if your user DN has the correct priviledge.

    The code example below connects to an LDAP(S) directory using an application DN, looks up the full user DN based on their uid and then binds using the user DN and their password to check if it is OK.

      Many thanks, that was of great help.