ldap4net icon indicating copy to clipboard operation
ldap4net copied to clipboard

Binding Always Fails

Open nove1398 opened this issue 3 years ago • 5 comments

Describe the bug Unable to bind on Linux platform, but works on windows

To Reproduce simply attempt to bind cn.Bind(LdapForNet.Native.Native.LdapAuthType.Digest, new LdapCredential { UserName = "user@domain", Password = "password", AuthorizationId = "u:user" });

Expected behavior A successful binding

Desktop (please complete the following information):

  • OS: Linux Ubunto 20.4

Additional context Using to LDAP into Active Directory

nove1398 avatar Jul 20 '21 21:07 nove1398

Did you install the prerequisites? For Linux\OSX you must ensure you have the latest OpenLDAP client libraries installed from http://www.openldap.org. Also you should install libsasl modules for digest-md5 (libsasl2-modules)

flamencist avatar Jul 21 '21 08:07 flamencist

I will look into it now, I really love how slim this library is personally, I just want it to work so I can use basic searching functionality.

nove1398 avatar Jul 21 '21 13:07 nove1398

I installed the libs for sasl2-modules. My Bind call looks like this:

cn.Bind(LdapForNet.Native.Native.LdapAuthType.Digest, new LdapCredential
            {
                UserName = "logonName",
                Password = "password",
                AuthorizationId = "dn:CN=First Last,DC=first,DC=second,DC=third"
            });

Not sure if that is the correct format, it may be my incorrect input. Please advise.

Update The error returned looks like this LdapForNet.LdapInvalidCredentialsException: Invalid credentials. 8009030B: LdapErr: DSID-0C0904DC, comment: AcceptSecurityContext error, data 0, v1db1. Result: 49. Method: BindSasl

nove1398 avatar Jul 21 '21 13:07 nove1398

You dont need AuthorizationId. Example: https://github.com/flamencist/ldap4net/blob/a126279e6cfc14547d762f8cff23ee0568bce956/LdapForNet.Tests/LdapConnectionTests.cs#L53

flamencist avatar Jul 21 '21 18:07 flamencist

Is authentication work on linux?

flamencist avatar Mar 26 '22 18:03 flamencist