The LDAP Authentication module trims white space from the password field. This means that any user having leading or trailing whitespace in their password will never be able to authenticate.

The solution is very simple: remove the trim() call in line 276 of ldapauth.module:

function ldapauth_authenticate($form_values = array()) {
  global $user, $_ldapauth_ldap;

  $name = $form_values['name'];
  // INCORRECT - do not assume passwords will never start/end with white space:
  // $pass = trim($form_values['pass']);
  $pass = $form_values['pass'];

  /* remainder of method trimmed */

Best regards, and thanks for this very useful module!

Olivier Biot

Comments

johnbarclay’s picture

Assigned: Unassigned » johnbarclay
Priority: Critical » Major
Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.