Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-6550

add flexiblity to LDAP search attribute, instead of just attribute=username, complete filter can be defined.

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Major Major
    • ldapemail-plugin
    • None

      LDAP Email Plugin requires the search attribute must be formatted to 'attribute=value'.

      I would like more options for selection of LDAP search attribute.

      Example search attribute : (&(ID=%s)(cn=prefix*))

      The 'LdapMailAddressResolver' requires one simple change to support this. Instead of "search attribute" being the attribute, it is an LDAP filter with %s entered for where userName is to be inserted.

      private String performSearch(DirContext ctx, String userName) throws NamingException {
      String emailAddress = null;
      SearchControls controls = new SearchControls();
      controls.setSearchScope(SearchControls.SUBTREE_SCOPE);
      //String filter = String.format("%s=%s", configuration.getSearchAttribute(), userName);
      String filter = String.format(configuration.getSearchAttribute(), userName);

            justinedelson justinedelson
            buesing buesing
            Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated: