Uploaded image for project: 'Apache Knox'
  1. Apache Knox
  2. KNOX-2881

KnoxCLI doesn’t hande ALIAS in (system)-user-auth-test

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.2.0, 1.3.0, 1.4.0, 1.5.0, 2.0.0, 1.6.0, 1.6.1
    • 2.1.0
    • KnoxCLI
    • None

    Description

      When topology has 

        <param>
          <name>main.ldapRealm.contextFactory.systemPassword</name>
          <value>${ALIAS=knoxldapsystempassword}</value>
        </param>
      

      The validations fail as:

      # /bin/knoxcli.sh system-user-auth-test --cluster ldapUsecase1Topo2
      org.apache.shiro.authc.AuthenticationException: LDAP authentication failed.
      [LDAP: error code 49 - 80090308: LdapErr: DSID-0C09042A, comment: AcceptSecurityContext error, data 52e, v3839]
      For more information use --d for debug output.
      Unable to successfully bind to LDAP server with topology credentials. Are your parameters correct?
      
      # bin/knoxcli.sh user-auth-test --cluster ldapUsecase1Topo2 --u user1 --p Test123
      org.apache.shiro.config.ConfigurationException: Unable to set property 'contextFactory.systemPassword' with value [S{ALIAS=knoxldapsystempassword}] on object of type org.apache.knox.gateway.shirorealm.KnoxLdapRealm.  If 'S{ALIAS=knoxldapsystempassword}' is a reference to another (previously defined) object, prefix it with '$' to indicate that the referenced object should be used as the actual value.  For example, $S{ALIAS=knoxldapsystempassword}
      org.apache.knox.gateway.util.KnoxCLI$LDAPCommand$BadSubjectException: Subject could not be created with Shiro Config at sections=main,urls
      For more information use --d for debug output.
      ERR: Unable to authenticate user: user1
      

      Note: we checked that the keystore has the right password value set:

      # ${JAVA} GetValueFromJCEKS ${JCEKSFILE} ${JCEKSPASS} ${PW_ALIAS}
      Test123
      

       
      When the topology is configured with a plain password like:

        <param>
          <name>main.ldapRealm.contextFactory.systemPassword</name>
          <value>Test123</value>
        </param>
      

      The validations run with no errors:

      # bin/knoxcli.sh system-user-auth-test --cluster ldapUsecase1Topo3
      System LDAP Bind successful.
      
      # bin/knoxcli.sh user-auth-test --cluster ldapUsecase1Topo3 --u user1 --p Test123
      LDAP authentication successful!

      Attachments

        Issue Links

          Activity

            People

              smolnar Sandor Molnar
              smolnar Sandor Molnar
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m