-
Bug
-
Resolution: Unresolved
-
Minor
-
None
-
AD plugin v1.37, Jenkins 1.56, Running as a service, Windows Server 2012 R2, Active Directory with multiple domains
Logs show that the plugin has correctly matched my username against the right DC and authenticated correctly. All my groups are printed along with some additional ldap content. Then there's a two minute gap in the logs around Stage 2:
Apr 22, 2014 11:46:27 PM FINE hudson.plugins.active_directory.ActiveDirectoryUnixAuthenticationProvider Stage 2: looking up via memberOf Apr 22, 2014 11:48:27 PM FINE hudson.plugins.active_directory.ActiveDirectoryUnixAuthenticationProvider CN=Jon Wiswall,OU=<ou>,OU=<ou>,DC=<dc>,DC=<dc>,DC=<dc>,DC=<dc> is a member of cn: <group name>
After the 2-minute break the log prints the first 20 or so of my ~150 group memberships.
Looks like the LDAP server gives up at this point:
Failed to retrieve user information for <username> javax.naming.TimeLimitExceededException: [LDAP: error code 3 - Timelimit Exceeded]; remaining name 'DC=<dc>,DC=<dc>,DC=<dc>,DC=<dc>' at com.sun.jndi.ldap.LdapCtx.mapErrorCode(Unknown Source) at com.sun.jndi.ldap.LdapCtx.processReturnCode(Unknown Source) at com.sun.jndi.ldap.LdapCtx.processReturnCode(Unknown Source) at com.sun.jndi.ldap.LdapNamingEnumeration.getNextBatch(Unknown Source) at com.sun.jndi.ldap.LdapNamingEnumeration.hasMoreImpl(Unknown Source) at com.sun.jndi.ldap.LdapNamingEnumeration.hasMore(Unknown Source) at hudson.plugins.active_directory.ActiveDirectoryUnixAuthenticationProvider.parseMembers(ActiveDirectoryUnixAuthenticationProvider.java:456)
... which then fails the Jenkins login with an authentication failed message.
I'm sure this is to do with our large Active Directory deployment.
Could the plugin only check the username/pw combo, and then if matrix or project-based security is enabled, check if the named groups are present? The initial auth step (which dumps all the groups anyhow) is super fast.
(Note: marked bug as 'minor' but I can't really point my team at my Jenkins instance until this works.)
+1 , same issue on our Windows 2008R2 Jenkins installation.
On our RedHat Linux Jenkins installation, in Active Directory settings under Configure Global Security...it allows for 5 inputs, one of those being Bind DN and Bind Password. When we set this to the service account user, it fixed this. (I assume by filtering it's search)
But on the Windows server, this option isn't available and I don't see anywhere else to enter Bind DN and narrow down my search, avoiding the timeouts. I tried manually copying value into Config.xml, but that didn't work either.