Uploaded image for project: 'DSpace'
  1. DSpace
  2. DS-1781

LDAP never uses the specified email_field

    Details

    • Attachments:
      1
    • Comments:
      9
    • Documentation Status:
      Not Required

      Description

      Reported by email by rlseaton: http://dspace.2283337.n4.nabble.com/DSpace-LDAP-authentication-problem-tp4665853p4668861.html

      I was having the same problem with the "null" string appearing and helix84's fix worked in 3.2.

      However, I wanted to let you know that the way the conditionals are set up in the fixed LDAPAuthentication.java file makes it so that LDAP authentication never uses the email_field specified in authentication-ldap.cfg if it's available.

      I simply replaced this (~line 255):
      if ((StringUtils.isEmpty(email)) &&
      (StringUtils.isNotEmpty(ConfigurationManager.getProperty("authentication-ldap", "netid_email_domain"))))
      {
      email = netid + ConfigurationManager.getProperty("authentication-ldap", "netid_email_domain");
      }
      else
      {
      email = netid;
      }

      with this:
      if (StringUtils.isEmpty(email))
      {
      if((StringUtils.isNotEmpty(ConfigurationManager.getProperty("authentication-ldap", "netid_email_domain"))))

      { email = netid + ConfigurationManager.getProperty("authentication-ldap", "netid_email_domain"); }

      else

      { email = netid; }

      }

      And that fixed the problem.

      Now when new users are auto-registered via LDAP, if the email string isn't empty it will correctly use it instead of replacing it with only the netid.

        Attachments

          Activity

            People

            • Assignee:
              tdonohue Tim Donohue
              Reporter:
              helix84 Ivan Masár
            • Votes:
              2 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: