• Icon: Bug Bug
    • Resolution: Postponed
    • Icon: Major Major
    • core
    • None
    • Platform: PC, OS: Linux

      We have a perfectly fine LDAP server setup that things like ReviewBoard uses for
      authentication. However, Hudson does not.

      Example session when querying the user "chainsaw" via ldapsearch:
      -----------------------------------------------------------------
      ldapsearch -h 192.168.1.103 -x -D "cn=Manager,dc=domain,dc=name" -W uid=chainsaw
      Enter LDAP Password: somethingdarkside

      1. extended LDIF
        #
      2. LDAPv3
      3. base <> with scope subtree
      4. filter: uid=chainsaw
      5. requesting: ALL
        #
      1. Jens B\C3\A4ckman, People, domain.name
        uid: chainsaw
        homeDirectory: /home/chainsaw
        loginShell: /bin/bash
        objectClass: inetOrgPerson
        objectClass: posixAccount
        objectClass: top
        much-more-stuff-here-but-snipped
      1. search result
        search: 2
        result: 0 Success
      1. numResponses: 2
      2. numEntries: 1

      Hudson config file, the important parts:
      -----------------------------------------------------------------
      <version>1.319</version>
      <securityRealm class="hudson.security.LDAPSecurityRealm">
      <server>domain.name</server>
      <rootDN></rootDN>
      <userSearchBase></userSearchBase>
      <userSearch>uid=

      {0}

      </userSearch>
      <managerDN>cn=Manager,dc=domain,dc=name</managerDN>
      <managerPassword>somethingdarkside</managerPassword>
      </securityRealm>

      Hudson backtrace:
      -----------------------------------------------------------------
      2009-aug-11 11:45:21 hudson.security.AuthenticationProcessingFilter2
      onUnsuccessfulAuthentication

      INFO: Login attempt failed
      org.acegisecurity.AuthenticationServiceException: LdapCallback;[LDAP: error code
      32 - No Such Object]; nested exception is javax.naming.NameNotFoundException:
      [LDAP: error code 32 - No Such Object]; remaining name ''; nested exception is
      org.acegisecurity.ldap.LdapDataAccessException: LdapCallback;[LDAP: error code
      32 - No Such Object]; nested exception is javax.naming.NameNotFoundException:
      [LDAP: error code 32 - No Such Object]; remaining name ''

      at
      org.acegisecurity.providers.ldap.LdapAuthenticationProvider.retrieveUser(LdapAuthenticationProvider.java:238)

      at
      org.acegisecurity.providers.dao.AbstractUserDetailsAuthenticationProvider.authenticate(AbstractUserDetailsAuthenticationProvider.java:119)

      at
      org.acegisecurity.providers.ProviderManager.doAuthentication(ProviderManager.java:195)

      at
      org.acegisecurity.AbstractAuthenticationManager.authenticate(AbstractAuthenticationManager.java:45)

      at
      org.acegisecurity.ui.webapp.AuthenticationProcessingFilter.attemptAuthentication(AuthenticationProcessingFilter.java:71)

      at
      org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:252)

      at
      hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)

      at
      org.acegisecurity.ui.basicauth.BasicProcessingFilter.doFilter(BasicProcessingFilter.java:173)

      at
      hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)

      at
      org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249)

      at
      hudson.security.HttpSessionContextIntegrationFilter2.doFilter(HttpSessionContextIntegrationFilter2.java:66)

      at
      hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)

      at
      hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:76)

      at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:155)
      at winstone.FilterConfiguration.execute(FilterConfiguration.java:195)
      at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:368)
      at winstone.RequestDispatcher.forward(RequestDispatcher.java:333)
      at
      winstone.RequestHandlerThread.processRequest(RequestHandlerThread.java:244)

      at winstone.RequestHandlerThread.run(RequestHandlerThread.java:150)
      at java.lang.Thread.run(Thread.java:636)
      Caused by: org.acegisecurity.ldap.LdapDataAccessException: LdapCallback;[LDAP:
      error code 32 - No Such Object]; nested exception is
      javax.naming.NameNotFoundException: [LDAP: error code 32 - No Such Object];
      remaining name ''
      at
      org.acegisecurity.ldap.LdapTemplate$LdapExceptionTranslator.translate(LdapTemplate.java:295)
      at org.acegisecurity.ldap.LdapTemplate.execute(LdapTemplate.java:128)
      at
      org.acegisecurity.ldap.LdapTemplate.searchForSingleEntry(LdapTemplate.java:246)
      at
      org.acegisecurity.ldap.search.FilterBasedLdapUserSearch.searchForUser(FilterBasedLdapUserSearch.java:119)
      at
      org.acegisecurity.providers.ldap.authenticator.BindAuthenticator.authenticate(BindAuthenticator.java:71)
      at
      org.acegisecurity.providers.ldap.authenticator.BindAuthenticator2.authenticate(BindAuthenticator2.java:49)
      at
      org.acegisecurity.providers.ldap.LdapAuthenticationProvider.retrieveUser(LdapAuthenticationProvider.java:233)
      ... 19 more
      Caused by: javax.naming.NameNotFoundException: [LDAP: error code 32 - No Such
      Object]; remaining name ''
      at com.sun.jndi.ldap.LdapCtx.mapErrorCode(LdapCtx.java:3057)
      at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2978)
      at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2785)
      at com.sun.jndi.ldap.LdapCtx.searchAux(LdapCtx.java:1839)
      at com.sun.jndi.ldap.LdapCtx.c_search(LdapCtx.java:1762)
      at com.sun.jndi.ldap.LdapCtx.c_search(LdapCtx.java:1779)
      at
      com.sun.jndi.toolkit.ctx.ComponentDirContext.p_search(ComponentDirContext.java:412)
      at
      com.sun.jndi.toolkit.ctx.PartialCompositeDirContext.search(PartialCompositeDirContext.java:394)
      at
      com.sun.jndi.toolkit.ctx.PartialCompositeDirContext.search(PartialCompositeDirContext.java:376)
      at
      javax.naming.directory.InitialDirContext.search(InitialDirContext.java:284)
      at
      org.acegisecurity.ldap.LdapTemplate$3.doInDirContext(LdapTemplate.java:249)
      at org.acegisecurity.ldap.LdapTemplate.execute(LdapTemplate.java:126)
      ... 24 more

          [JENKINS-4195] Authentication via LDAP fails

            Unassigned Unassigned
            czw czw
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: