OpenLDAP Authentication UID vs CN issues

Posted by user145457 on Server Fault See other posts from Server Fault or by user145457
Published on 2012-11-14T10:18:11Z Indexed on 2012/11/14 11:05 UTC
Read the original article Hit count: 390

Filed under:
|
|
|
|

I'm having trouble authenticating services using uid for authentication, which I thought was the standard method for authentication on the user. So basically, my users are added in ldap like this:

# jsmith, Users, example.com
dn: uid=jsmith,ou=Users,dc=example,dc=com
uidNumber: 10003
loginShell: /bin/bash
sn: Smith
mail: [email protected]
homeDirectory: /home/jsmith
displayName: John Smith
givenName: John
uid: jsmith
gecos: John Smith
gidNumber: 10000
cn: John Smith
title: System Administrator

But when I try to authenticate using typical webapps or services like this:

jsmith
password

I get:

ldapsearch -x -h ldap.example.com -D "cn=jsmith,ou=Users,dc=example,dc=com" -W -b "dc=example,dc=com"
Enter LDAP Password:
ldap_bind: Invalid credentials (49)

But if I use:

ldapsearch -x -h ldap.example.com -D "uid=jsmith,ou=Users,dc=example,dc=com" -W -b "dc=example,dc=com"

It works.

HOWEVER...most webapps and authentication methods seem to use another method. So on a webapp I'm using, unless I specify the user as: uid=smith,ou=users,dc=example,dc=com Nothing works.

In the webapp I just need users to put: jsmith in the user field.

Keep in mind my ldap is using the "new" cn=config method of storing settings. So if someone has an obvious ldif I'm missing please provide.

Let me know if you need further info. This is openldap on ubuntu 12.04.

Thanks,

Dave

© Server Fault or respective owner

Related posts about ubuntu

Related posts about ldap