2

I understand that if you try to authenticate with an email address e.g. me@server.com, ldap assumes there is a user "me" in a domain "server.com" (i.e DC=com,DC=server) in the ldap directory.

I wonder if it is possible at all to have users use their own email accounts (like me@gmail.com) to login to my ldap server even though I don't have all ther email address domain names defined as domains in my ldap directory?

Any pointers appreciated.

3

This question probably needs more specifics, like what software is performing the auth, what LDAP server is it authing against? Generally speaking, you can do whatever the heck you want to allow yourself to do in LDAP.

My think would be:

dn: uid=me,dc=server,dc=com

And then me has an attribute:

emailAddress=me@gmail.com

for this latter case, if you were using Apache to auth, you might have a configuration like this:

AuthType Basic
AuthName "Log in with your e-mail address"
AuthBasicProvider ldap
AuthLDAPURL "ldap://ldap.example.com/dc=example,dc=com?emailAddress"
require valid-user

Here, Apache would search for a user with emailAddress=me@gmail.com, and log in user me using that address.

-danny

| improve this answer | |
  • Thanks for the reply @dannyman, the server options are openldap or Microsoft's Active Drirectory, in the end the software that will be perfoming the authentication will be a php client (Zend_Auth to be specific), however I want to know a general way of authenticating users with their emails which I can use for any ldap client. Thanks – Haddad Mar 9 '11 at 8:35
  • 1
    Haddad: So, looking at framework.zend.com/manual/en/zend.auth.adapter.ldap.html, the accountFilterFormat option could be used to specify that your username is stored in something like emailAddress=%s. – dannyman Mar 9 '11 at 21:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.