In the organization that I work for, we develop applications that all use LDAP for authentication (so usernames and passwords are the same across the board). I've installed drupal to use as a replacement for our static pages, and while working with the LDAP module, I've noticed that there is a feature that might be useful that isn't included.

We use our email addresses as our logins (so, firstname.lastname@company.com). The only problem is that some people in the organization have different domains (ie, firstname.lastname@company2.com). In our applications, we strip off the suffix (@company.com) and just do an LDAP search based on the prefix, and then bind to the returned DN.

What I'm thinking, is that if the ability to add a wildcard to the search was added, it would help others who may be having the same problem. One of the things that need to be changed is: Line 384 needs to be changed from
$filter = "$name_attr=$name";
to
$filter = "$name_attr=$name*";

Comments

johnbarclay’s picture

It would take more that this.

<?php
$filter = "$name_attr=$name*";
?>

would mix jo@blah.com and joseph@blah.com up.

You would really need a user defined wildcard that would be set in the admin interface so it could be configured and turned on and off and customized to the particular username format.

<?php
$filter = "$name_attr=$name" . if(LDAPAUTH_NAME_WILDCARD) ? LDAPAUTH_NAME_WILDCARD : '';
?>
miglius’s picture

Status: Active » Closed (won't fix)

As johnbarclay noted above, adding wildcards can introduce a serious security hole in the authentication process.