I am setting up a new installation of EspoCRM 5.7.11 to use LDAP Authentication. Testing the connection in the Authentication settings works, but no users are able to successfully login. The error at the login page is "Wrong username/password". Here is the LDAP configuration:
Here is what I'm seeing in the log when I try to login using the correct password:
If I use the wrong password on purpose, the error changes to reflect the bad credential, which tells me it is authenticating correctly up to a certain point:
I know the LDAP server is able to accept the login because the following command works:
Here is the output:
I am able to login using ldapsearch with many users and the LDAP server will reject the connection if I specify the wrong credentials on purpose. It seems like Espo is correctly authenticating, but then rejecting the login for some reason. Am I using the wrong objectClass? What about the uid? It's setup as firstName.lastName and that's what I am using to login, e.g."uid: John.Doe" and then I try to login using "username: John.Doe, password: xxxx". If I use anything other than the uid to login, the log file shows an invalid credential error, which is what I would expect. That tells me it is accepting the uid field as the username, so I have no idea what to check next.
Code:
'authenticationMethod' => 'LDAP', 'ldapUserNameAttribute' => 'uid', 'ldapUserObjectClass' => 'inetOrgPerson', 'ldapHost' => 'ldap.xxxxx.com', 'ldapPort' => '389', 'ldapAuth' => true, 'ldapSecurity' => 'TLS', 'ldapUsername' => 'uid=xxxxx.xxxxx,ou=Users,o=xxxxx,dc=xxxxx,dc=com', 'ldapPassword' => 'xxxxx', 'ldapBindRequiresDn' => true, 'ldapBaseDn' => 'o=xxxxx,dc=xxxxx,dc=com', 'ldapUserLoginFilter' => 'memberOf=cn=EspoCRM LDAP Users,ou=Users,o=xxxxx,dc=xxxxx,dc=com', 'ldapTryUsernameSplit' => false, 'ldapOptReferrals' => false, 'ldapCreateEspoUser' => false, 'ldapAccountCanonicalForm' => 'Dn'
Code:
[2020-01-09 20:40:35] Espo.DEBUG: LDAP: user search string: "(&(objectClass=inetOrgPerson)(uid=xxxxx.xxxxx)(memberOf=cn=EspoCRM LDAP Users,ou=Users,o=xxxxx,dc=xxxxx,dc=com))" [] [] [2020-01-09 20:40:35] Espo.DEBUG: User [xxxxx.xxxxx] is found with this DN [uid=xxxxx.xxxxx,ou=Users,o=xxxxx,dc=xxxxx,dc=com]. [] []
Code:
[2020-01-09 20:57:29] Espo.DEBUG: User [xxxxx.xxxxx] is found with this DN [uid=xxxxx.xxxxx,ou=Users,o=xxxxx,dc=xxxxx,dc=com]. [] [] [2020-01-09 20:57:29] Espo.ERROR: LDAP: Authentication failed for user [xxxxx.xxxxx], details: 0x31 (Invalid credentials): uid=xxxxx.xxxxx,ou=Users,o=xxxxx,dc=xxxxx,dc=com [] []
Code:
ldapsearch -D "uid=xxxxx.xxxxx,ou=Users,o=xxxxx,dc=xxxxx,dc=com" -h ldap.xxxxx.com -w 'xxxxx -b "o=xxxxx,dc=xxxxx,dc=com" "memberOf=cn=EspoCRM LDAP Users,ou=Users,o=xxxxx,dc=xxxxx,dc=com"
Code:
# extended LDIF # # LDAPv3 # base <o=xxxxx,dc=xxxxx,dc=com> with scope subtree # filter: memberOf=cn=EspoCRM LDAP Users,ou=Users,o=xxxxx,dc=xxxxx,dc=com # requesting: ALL # # xxxxx.xxxxx, Users, xxxxx, xxxxx.com dn: uid=xxxxx.xxxxx,ou=Users,o=xxxxx,dc=xxxxx,dc=com uid: xxxxx.xxxxx mail: xxxxx@xxxxx.com cn: xxxxx xxxxx objectClass: top objectClass: person objectClass: organizationalPerson objectClass: inetOrgPerson objectClass: shadowAccount objectClass: posixAccount objectClass: jumpcloudUser uidNumber: 5001 gidNumber: 5001 memberOf: cn=EspoCRM LDAP Users,ou=Users,o=xxxxx,dc=xxxxx,dc=com # xxxxx.xxxxx, Users, xxxxx, xxxxx.com dn: uid=xxxxx.xxxxx,ou=Users,o=xxxxx,dc=xxxxx,dc=com uid: xxxxx.xxxxx mail: xxxxx@xxxxx.com cn: xxxxx xxxxx objectClass: top objectClass: person objectClass: organizationalPerson objectClass: inetOrgPerson objectClass: shadowAccount objectClass: posixAccount objectClass: jumpcloudUser uidNumber: 5001 gidNumber: 5001 memberOf: cn=EspoCRM LDAP Users,ou=Users,o=xxxxx,dc=xxxxx,dc=com ... # search result search: 2 result: 0 Success # numResponses: 19 # numEntries: 18
I am able to login using ldapsearch with many users and the LDAP server will reject the connection if I specify the wrong credentials on purpose. It seems like Espo is correctly authenticating, but then rejecting the login for some reason. Am I using the wrong objectClass? What about the uid? It's setup as firstName.lastName and that's what I am using to login, e.g."uid: John.Doe" and then I try to login using "username: John.Doe, password: xxxx". If I use anything other than the uid to login, the log file shows an invalid credential error, which is what I would expect. That tells me it is accepting the uid field as the username, so I have no idea what to check next.
Comment