I have a problem with the ldap_authentication module, because all the users of my Active directory have the special character "." for example: "mary.dr" So when y try to login with these types of users, drupal shows the message: "Sorry, unrecognized username or password." I already tried to login with an user who doesn´t have that character and it allow me to login. So the problem is when I trie to do it with an user who have a "." I need some help here, because I´ve tried many things and none of them have worked.
Thanks.

Comments

johnbarclay’s picture

Version: 7.x-1.0-beta5 » 7.x-1.x-dev

Try this, in the server configuration under: "PHP to transform Drupal login username to LDAP UserName attribute," add:

print str_replace('.', '_', $name);
This would turn what the user typed in from mary.dr to mary_dr

If this works, can you add it to the list of cases at: http://drupal.org/node/1065900

If it doesn't can you followup? This seems like a very basic use case that needs to be resolved as soon as possible.

johnbarclay’s picture

Title: Ldap_authentication user with character "." » LDAP User: Deal with common special characters such as "." in usernames
Version: 7.x-1.x-dev » 7.x-2.x-dev
Category: support » feature
johnbarclay’s picture

Status: Active » Needs review

In drupal usernames, spaces are allowed; punctuation is not allowed except for periods, hyphens, apostrophes, and underscores. So I don't see this as an issue.

If a need to pursue this comes up, a simple approach would be to map the "expected" unacceptable characters in user_validate_name() to acceptable ones, then run the resulting username through user_validate_name() to make sure the username was still valid. This presents one security problem where jane@doe and jane!doe in LDAP would both map to jane_doe, where _ is the replacement character.

The "," is the only character I can think of that come up such as cn=Doe\, Jane,ou=blah,... Please chime in with other common characters disallowed in drupal usernames and we can add a checkbox in the config form to have these converted automatically.

See also http://api.drupal.org/api/drupal/modules%21user%21user.module/function/u...

johnbarclay’s picture

Status: Needs review » Postponed
larowlan’s picture

Issue summary: View changes
Status: Postponed » Closed (won't fix)

no update for > 12 months, no patches - closing