Geronimo
  1. Geronimo
  2. GERONIMO-4997

Can not connect to a ldap server in an anonymous way

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.1.4, 2.2
    • Fix Version/s: 2.1.5, 2.2.1, 3.0.0
    • Component/s: security
    • Security Level: public (Regular issues)
    • Labels:
      None
    • Environment:

      OS:Windows XP SP2
      Server: Geronimo 2.2
      JDK:1.6

      Description

      I tried to deploy an web application which uses Apache Directory Server for user authentication.
      So I created a realm file as follows and add a reference to this realm file in deploy plan

      <module xmlns="http://geronimo.apache.org/xml/ns/deployment-1.2">
      <environment>
      <moduleId>
      <groupId>console.realm</groupId>
      <artifactId>testLDAP</artifactId>
      <version>1.0</version>
      <type>car</type>
      </moduleId>
      <dependencies>
      <dependency>
      <groupId>org.apache.geronimo.framework</groupId>
      <artifactId>j2ee-security</artifactId>
      <type>car</type>
      </dependency>
      </dependencies>
      </environment>
      <gbean name="testLDAP" class="org.apache.geronimo.security.realm.GenericSecurityRealm" xsi:type="dep:gbeanType" xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <attribute name="realmName">testLDAP</attribute>
      <reference name="ServerInfo">
      <name>ServerInfo</name>
      </reference>
      <xml-reference name="LoginModuleConfiguration">
      <log:login-config xmlns:log="http://geronimo.apache.org/xml/ns/loginconfig-2.0">
      <log:login-module control-flag="REQUIRED" wrap-principals="false">
      <log:login-domain-name>testLDAP</log:login-domain-name>
      <log:login-module-class>org.apache.geronimo.security.realm.providers.LDAPLoginModule</log:login-module-class>
      <log:option name="connectionURL">ldap://pages.test.com:389</log:option>
      <log:option name="roleBase">ou=members,ou=testgroups,o=test.com</log:option>
      <log:option name="initialContextFactory">com.sun.jndi.ldap.LdapCtxFactory</log:option>
      <log:option name="roleName">cn</log:option>
      <log:option name="roleSearchMatching">uniquemember=

      {0}</log:option>
      <log:option name="roleSearchSubtree">false</log:option>
      <log:option name="userRoleName">uniquemember={0}

      </log:option>
      <log:option name="authentication">simple</log:option>
      <log:option name="userSearchSubtree">true</log:option>
      <log:option name="userBase">ou=users,o=test.com</log:option>
      <log:option name="userSearchMatching">(mail=

      {0}

      )</log:option>
      </log:login-module>
      </log:login-config>
      </xml-reference>
      </gbean>
      </module>

      It provides no connectionUsername and password ,because I intend to connect the ldap server anonymously.
      Eache time,I login the web application ,it will try to connect the Apache directory server to authenticate users.
      But a NullPointerException will always occur.
      Caused by:
      java.lang.NullPointerException
      at java.util.Hashtable.put(Hashtable.java:770)
      at org.apache.geronimo.security.realm.providers.LDAPLoginModule.open(LDAPLoginModule.java:455)
      at org.apache.geronimo.security.realm.providers.LDAPLoginModule.authenticate(LDAPLoginModule.java:267)
      at org.apache.geronimo.security.realm.providers.LDAPLoginModule.login(LDAPLoginModule.java:186)
      ... 28 more

        Issue Links

          Activity

          Lu Jiang made changes -
          Status Reopened [ 4 ] Closed [ 6 ]
          Resolution Fixed [ 1 ]
          Lu Jiang made changes -
          Attachment geronimo-security-2.1.4.jar [ 12435419 ]
          Lu Jiang made changes -
          Resolution Fixed [ 1 ]
          Status Closed [ 6 ] Reopened [ 4 ]
          Rex Wang made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Jürgen Weber made changes -
          Link This issue is required by GERONIMO-4513 [ GERONIMO-4513 ]
          Ivan made changes -
          Field Original Value New Value
          Status Open [ 1 ] Resolved [ 5 ]
          Fix Version/s 2.1.5 [ 12313729 ]
          Fix Version/s 2.2.1 [ 12314336 ]
          Fix Version/s 3.0 [ 12314206 ]
          Resolution Fixed [ 1 ]
          Lu Jiang created issue -

            People

            • Assignee:
              Unassigned
              Reporter:
              Lu Jiang
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development