Revisiting the ldap issue with a simple solution

LabKey Support Forum
Revisiting the ldap issue with a simple solution adam  2012-02-22 14:41
Status: Closed
 
I took a look at your patch. A couple minor issues:
  1. Your editor/IDE seems to be replacing spaces with tabs and reformatting line lengths, etc. It would be much easier if you could turn off this reformatting.
  2. There is a stray "e.printStackTrace();" in there… I'm assuming you didn't mean to include that.
  3. The commented out statement (searchCtls.setReturningAttributes(returnedAtts)) should be removed or re-enabled (or put under a run-time switch, if necessary).
  4. We will probably not bother with the pg.properties and labkey.xml changes; we'll document the new settings and anyone who needs this functionality can easily add the properties directly to their labkey.xml.
More substantial issues:
  1. Your patch includes a hard-coded, Rochester-specific constant in the code: "DC=urmc-sh,DC=rochester,DC=edu". Committing to the standard code base will require generalizing this, perhaps as another setting in labkey.xml.
  2. The patch would be smaller and the logic more straightforward if you checked for the presence of the special settings before attempting to authenticate. If the settings exist, use the search account to look up the user's principal; if the settings doesn't exist, just use the email that was typed in.
I've attached a revised patch of just the key file, removing the comments, tabs, and the reformatting (to focus on the important changes), but not addressing the other issues I mentioned. I'd like to hear your feedback on the suggestions and then we can decide how to proceed.

Adam