Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-78606

LDAP authentication doesn't work with Password Compare auth method and encryption

    Details

      Description

      Reproduction steps:

      1. Set up Liferay with OpenLDAP.
      2. Set LDAP password encryption to SHA-384 and authentication method to Password Compare
      3. Create a user in LDAP with SHA-384 encrypted password
      4. Try to log in with the created user

      Experenced behavior: you are unable to log in.

      Expected behavior: you should be able to log in.


      Notes to reproduce (Linux)

      Start OpenLDAP docker image

      docker run --name LPS-78606 --env LDAP_DOMAIN="example.com" --env LDAP_ADMIN_PASSWORD="secret" --env LDAP_TLS=false -p 10389:389 osixia/openldap
      

      Add user sha384@liferay.com with password secret

      (cat <<"EOF"
      # sha384
      dn: cn=sha384,dc=example,dc=com
      objectClass: top
      objectClass: person
      objectClass: inetOrgPerson
      objectClass: organizationalPerson
      objectClass: simpleSecurityObject
      cn: sha384
      sn: sha384
      givenName: sha384
      mail: sha384@liferay.com
      userPassword: {SHA384}WKd1ukESvjAFrkQHznV9iP2nHUBJe7gCbsrFTU4//HIyzo3jq1rLMK45dg/ufFPt
      
      EOF
      ) | docker exec -i LPS-78606 ldapadd -x -H ldap://localhost -D "cn=admin,dc=example,dc=com" -w secret
      

      Configure Liferay OpenLDAP

      • Control Panel -> Instance Settings -> Authentication -> LDAP
      • Check Enabled and Required
      • Password encryption: SHA-384
      • Authentication method: Password Compare
      • Add new LDAP server
        • Select OpenLDAP
        • URL: ldap://localhost:10389
        • Principal: cn=admin,dc=example,dc=com
        • Credentials: secret

      Sign in as sha384@liferay.com and password secret

        Attachments

        1. Failed.gif
          Failed.gif
          2.75 MB
        2. Fixed.PNG
          Fixed.PNG
          339 kB

          Issue Links

            Activity

              People

              • Assignee:
                harry.chai Harry Chai
                Reporter:
                istvan.sajtos Istvan Sajtos
                Participants of an Issue:
                Recent user:
                Csaba Turcsan
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  1 year, 12 weeks, 3 days ago

                  Packages

                  Version Package
                  7.1.X
                  Master