Search code examples
authenticationactive-directoryldapresponse

Does LDAP return whether a user login was successful?


Is it possible to retrieve information about LDAP authentication - whether it was successful or not?

I need to achieve the following scenario:

  • User navigates to login page, where only logon using Active Directory is available
  • If login was not successful, user will be redirected again to a login page, where also a secondary login option will become available

I know it is possible to retrieve information about user login history in Active Directory, but haven't find any info on whether it is possible to proceed in the way as I explained. Any help would be appreciated.


Solution

  • Does LDAP return whether a user login was successful?

    Within LDAP, a BIND REQUEST is sent by the client and a BIND RESPONSE is returned by the LDAP Server.

    If the client receives BIND RESPONSE of 0 then it is a successful, otherwise it is NOT.