1. Derby
  2. DERBY-1026

LDAP with caching DNs in derby.user.userName as database property does not work


    • Type: Bug Bug
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s:,,,,,
    • Fix Version/s: None
    • Component/s: Services
    • Urgency:
    • Issue & fix info:
    • Bug behavior facts:


      The documentation talks about LDAP support with mapping user names to derby users using the derby.user.'userName' property.

      See links

      Per the documentation, one can use the derby.user property to set the DN for a user,and when using LDAP, setting the search filter to derby.user will pick up the DN from this property if available. This is not working when I tried it out by caching a user's dn as a database-level property.

      Found the following issues:

      1)Setting the database property derby.user.userName to a DN does not work:
      Problem in AuthenticationServiceBase#map.
      – If there is a system property derby.authentication.provider=LDAP, setting of derby.user.userName to a DN value as a database property will encrypt the DN value and store it. The code seems to expect that the derby.authentication.provider is set to LDAP as a database property, else it considers it as a password and encrypts the value.
      – it doesnt return the correct mapped value for the property for the LDAP and derby.user.userName case. Returns null instead of returning the clear text DN value.

      2) the LDAP code itself doesnt pick up the userDN.

      In LDAPAuthenticationSchemeImpl#authenticateUser
      if (useUserPropertyAsDN)
      userDN =

      Here USER_PROPERTY_PREFIX is derby.user.
      The key should be USER_PROPERTY_PREFIX+userName.

      3) After the code issues are fixed, it would be nice if documentation can be added to give a full example of how to go about doing LDAP authentication with caching DNs in derby.user.

        Issue Links


          Sunitha Kambhampati created issue -
          Sunitha Kambhampati made changes -
          Field Original Value New Value
          Component/s Newcomer [ 12310640 ]
          Dag H. Wanvik made changes -
          Derby Categories [Newcomer]
          Dag H. Wanvik made changes -
          Component/s Newcomer [ 12310640 ]
          Dag H. Wanvik made changes -
          Derby Categories [Newcomer] [Security]
          Dag H. Wanvik made changes -
          Component/s Security [ 11411 ]
          Dag H. Wanvik made changes -
          Component/s Services [ 11415 ]
          Dag H. Wanvik made changes -
          Issue & fix info [Newcomer]
          Mike Matrigali added a comment -

          10.8 derby triage

          Mike Matrigali added a comment - 10.8 derby triage
          Mike Matrigali made changes -
          Labels derby_triage10_8
          Urgency Normal
          Knut Anders Hatlen made changes -
          Link This issue is duplicated by DERBY-4976 [ DERBY-4976 ]
          Gavin made changes -
          Workflow jira [ 12347430 ] Default workflow, editable Closed status [ 12802095 ]


            • Assignee:
              Sunitha Kambhampati
            • Votes:
              0 Vote for this issue
              1 Start watching this issue


              • Created: