Homec4science

Resolve LDAP registration DAO exception due to empty username

Authored by Brian Cline <bcline@softlayer.com> on Aug 24 2012, 17:42.

Description

Resolve LDAP registration DAO exception due to empty username

Summary:
When logging in as an LDAP user for the first time (thus registering), a DAO exception was being thrown because PhabricatorLDAPRegistrationController wasn't passing in a username to PhabricatorUser::setUsername().

Somewhat separately, since either the PHP LDAP extension's underlying library or Active Directory are returning attributes with lowercased key names, I have to search on sAMAccountName and look for the key samaccountname in the results; this is fine since the config allows these to be defined separately. However I found that PhabricatorLDAPProvider::retrieveUserName() was attempting to use the search attribute rather than the username attribute. This resolves.

Test Plan: Tested registration and login against our internal AD infrastructure; worked perfectly. Need help from someone with access to a functional non-AD LDAP implementation; I've added the original author and CCs from D2722 in case they can help test in this regard.

Reviewers: epriestley, voldern

Reviewed By: voldern

CC: voldern, aran, Korvin, auduny, svemir

Differential Revision: https://secure.phabricator.com/D3340

Details

Committed
epriestley <git@epriestley.com>Aug 24 2012, 17:43
Pushed
aubortJan 31 2017, 17:16
Parents
rPH5a0b640ccd00: Bump cache version
Branches
Unknown
Tags
Unknown

Event Timeline

epriestley <git@epriestley.com> committed rPHb0802a779762: Resolve LDAP registration DAO exception due to empty username (authored by Brian Cline <bcline@softlayer.com>).Aug 24 2012, 17:43