Jenkins Active Directory conntection: login fails with indexed and full searches both failed

active-directoryJenkins

I'm trying to set up Active Directory on my Jenkins server. Jenkins can communicate with my AD server, but whenever I try to log in I get "Invalid login information. Please try again."

The Jenkins log contains the following (partial) stack trace:

Caused by: javax.naming.NamingException: [LDAP: error code 1 – 00002020: Indexed and full searches both failed!]; remaining name 'DC=mycompany,DC=mydomain'

Using the Test connection option returns success and when I attempt to add privileges to a group or user that doesn't exist in AD, the interface tells me so.

I've wiresharked my connection to the AD server. It appears authentication is succeeding, but the server fails to find the groups I belong to:

bindRequest(1) "CN=me,OU=mygroup,DC=mycompany,DC=mydomain" simple
bindResponse(1) success
searchRequest(2) "DC=DomainDnsZones,DC=mycompany,DC=mydomain" baseObject
searchResDone(2) success [0 results]
unbindRequest(3)

Best Answer

As it turns out, the default Group Membership Lookup Strategy configured in Jenkins (Auto) doesn't work well for this instance.

In your Jenkins Active Directory configuration, select Advanced and change Group Membership Lookup Strategy to Recursive group queries.

This is offered as a solution to another Jenkins AD group resolution here.