Login to ldap with uid instead of cn in DN input

2019-04-05 00:16发布

I'm running into a problem using LDAP to authenticate logins.

I already created a user with all basic info and try to login through phpldapadmin with detail :

Login DN: cn=Sample User,ou=people,dc=example,dc=om
Password: xxxx

then it can login.

But when i try to use with this :

Login DN: uid=sampleuser,ou=people,dc=example,dc=om
Password: xxxx

it never works (cannot login).

Please tell me what should i config?

标签: ldap
2条回答
相关推荐>>
2楼-- · 2019-04-05 00:59

If the LDAP client is using a simple BIND operation, then the BIND DN must exist. The simple BIND operation takes as arguments at least the DN and a password.

Consider the following entries:

dn: cn=sample user,ou=people,dc=example,dc=com
objectClass: top
objectClass: inetOrgPerson
cn: sample user
uid: sampleuser

is not the same entry as:

dn: uid=sampleuser,ou=people,dc=example,dc=com
objectClass: top
objectClass: inetOrgPerson
cn: sample user
uid: sampleuser

even though the attributes are identical (the SN which is required by inetOrgPerson is omitted in this example). Th DN is the primary key and must be used with the simple BIND operation. The entries given above, are two complete separate entries with two different DNs.

查看更多
狗以群分
3楼-- · 2019-04-05 01:07

I know its bit outdated but i was facing same problem. Thing is as Terry described that full dn's are different. You can fix this by forcing phpldapadmin to create users with uid as first key in dn.

You can change

<rdn>cn</rdn>

to

<rdn>uid</rdn>

in file

/etc/phpldapadmin/templates/creation/posixAccount.xml

That will create every posixAccount as:

dn: uid=sampleuser,ou=people,dc=example,dc=com
查看更多
登录 后发表回答