Review Board

beta

LDAP auth backend assumes things about how first and last names can be gathered.

Submitted
Updated 4 months, 1 week ago

Jordan Sissel Reviewers
reviewboard
None Review Board SVN
first_name and last_name are gathered (currently) by space-splitting the 'cn' field. This is correct unless you don't have spaces in your 'cn' field at which point user creation fails.

I have switched to using displayName, but this is not a permanent fix. I might recommend something similar to LDAP_UID_MASK, but it is not likely as simple.
I tested this on my server by logging in with an unregistered user using the LDAP backend. The user creation was successful.
Posted 5 months, 2 weeks ago (June 7th, 2008, midnight)

   

  
trunk/reviewboard/accounts/backends.py (Diff revision 1)
89
                first_name, last_name = passwd[0][1]['cn'][0].split(' ', 1)
89
                first_name, last_name = passwd[0][1]['displayName'][0].split(' ', 1)
Are we guaranteed to have a displayName variable with spaces? Can this have the same problem as cn?
  1. Jordan Sissel 5 months, 2 weeks ago (June 7th, 2008, 1:23 a.m.)
    IIRC, we should really be pulling first name from the 'givenName' field and the last name from the 'sn' (surname) field.
    
    Thoughts?
  2. Christian Hammond 4 months, 1 week ago (July 11th, 2008, 3:14 a.m.)
    I don't know LDAP well enough. If that's standard and we can rely on it, sure.
  3. David Trowbridge 4 months, 1 week ago (July 11th, 2008, 1:32 p.m.)
    Looks like it's a standard.  I'll make this change and submit it.