简体   繁体   English

Jenkins与LDAP的连接

[英]Jenkins connection to LDAP

Ok, I am completely stumped here. 好吧,我完全被困在这里了。 I am running the Jenkins application (v1.635) for Mac OSX. 我正在运行Mac OSX的Jenkins应用程序(v1.635)。 I am trying to connect to Active Directory through the LDAP Security Realm. 我正在尝试通过LDAP安全领域连接到Active Directory。 No matter what I try (and I have tried a good 30+ variants), the login fails and nothing gets written to the jenkins.log file. 不管我尝试什么(我已经尝试了30多个好的变体),登录都会失败,并且不会将任何内容写入jenkins.log文件。

I have ApacheDirectoryStudio installed and it connects flawlessly, so I know it is a Jenkins issue (and not a network or ACL issue). 我已经安装了ApacheDirectoryStudio,并且可以完美连接,所以我知道这是Jenkins问题(而不是网络或ACL问题)。

The LDAP server is using a self-signed SSL certificate, which I installed into the relevant cacerts file. LDAP服务器使用的是自签名SSL证书,该证书已安装到相关的cacerts文件中。

Here's my LDAP configuration (minus the sensitive corporate stuff) 这是我的LDAP配置(减去敏感的公司资料)

Server: ldaps://subdomain.domain.com:636
root DN: DC=domain,DC=com
User search base: OU=Users and Computers
User search filter: sAMAccountName={0}
Group search base: OU=Jenkins Groups,OU=Groups
Group search filter: (&(objectclass=group)(cn={0}))
Group membership: Parse user attribute for list of groups
    Group membership attribute: memberOf
Manager DN: CN=jenkins,OU=Users and Computers,DC=domain,DC=com
Manager Password: password
Display Name LDAP attribute: displayname
Email Address LDAP attribute: mail
Disable Ldap Email Resolver: unchecked

Any help is greatly appreciated. 任何帮助是极大的赞赏。 Even getting the log file to spit out some info would be great. 即使让日志文件吐出一些信息也很好。

Thanks! 谢谢!

Edit #1: Sometimes an exception does show up in the log file. 编辑1:有时日志文件中确实出现异常。 Hopefully this helps. 希望这会有所帮助。

    Nov 09, 2015 12:00:49 PM hudson.security.LDAPSecurityRealm$LDAPUserDetailsService loadUserByUsername
WARNING: Failed to search LDAP for username=myuser
org.acegisecurity.ldap.LdapDataAccessException: Unable to connect to LDAP server; nested exception is javax.naming.CommunicationException: subdomain.domain.com:636 [Root exception is java.net.SocketTimeoutException: Connect timed out]

Edit #2: I have to go to an 1 1/2 hour meeting, so my responses will be delayed. 编辑2:我必须参加1 1/2小时的会议,所以我的回复将被延迟。 Sorry. 抱歉。

So it's not ideal, but I was able to get the connection to work with the plain ldap connection (not ldaps). 因此,这不是理想的选择,但是我能够使该连接与普通ldap连接(而非ldaps)一起使用。 All I can figure is that Apache Directory Studio is smarter than Jenkins when it comes to establishing the connection. 我能想到的是,在建立连接时,Apache Directory Studio比Jenkins聪明。 I suspect there may be an issue with the self-signed SSL certificate chain that Jenkins can't quite figure out. 我怀疑Jenkins不太了解自签名SSL证书链的问题。 I really wish there was more verbosity to the logs in this matter. 我真希望日志中有更多的详细信息。 But for now, I have it working and since it is behind the corporate firewalls, the non-secure connection is less of a risk. 但是现在,我可以使用它了,并且由于它位于公司防火墙的后面,因此不安全的连接的风险较小。 I still intend to figure out the root cause, but for now, this will have to do. 我仍然打算找出根本原因,但就目前而言,这是必须要做的。 Thanks for your suggestions. 感谢您的建议。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM