kvspb / nginx-auth-ldap

LDAP authentication module for nginx
BSD 2-Clause "Simplified" License
732 stars 253 forks source link

Nginx ldap auth login by multiple attributes #90

Open summerQLin opened 9 years ago

summerQLin commented 9 years ago

I need to configure nginx to sign in by two kinds dn :

cn=appname,ou=Applications,o=example.com
uid=username,ou=People,o=example.com

Here is piece of code for ldap server:

ldap_server ldapserver {
  url ldaps://ldap.example.com/o=example.com?uid,cn?sub?(..filter for search...)
}

However, only username can be signed in, appname can't. But if I switch the position of uid and cn for that url, like

url ldaps://ldap.example.com/o=example.com?cn,uid?sub?(..filter for search...)

Then appname can be used to sign, username can't.

Doesn't nginx ldap support this?