修改Worklight的Liberty配置文件配置以使用LDAP&来自Worklight Studio的401s

时间:2014-07-30 21:40:57

标签: ldap ibm-mobilefirst worklight-studio websphere-liberty

经过一些磕磕绊绊后, 我能够将server.xml配置为命中LDAP。这很好。但是,现在我无法再从Worklight Studio部署了。

在jndi中使用错误的凭据会产生预期的错误;所以我必须假设在jndi配置的凭据正在工作。

[2014-07-30 16:05:34]无法将应用程序“应用程序”部署到Worklight Server:HTTP 401 - 未经授权`

并在worklight日志中:

    [ERROR   ] FWLST0003E: ========= Failed starting project /myproject [project myproject]
Error creating bean with name 'taskManager' defined in URL [wsjar:file:/C:/Users/user/luna-workspace-local/WorklightServerConfig/shared/resources/worklight-jee-library-6.2.0.jar!/conf/core.xml]: Cannot resolve reference to bean 'worklightAuthenticationService' while setting bean property 'authenticationService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'worklightAuthenticationService' defined in URL [wsjar:file:/C:/Users/user/luna-workspace-local/WorklightServerConfig/shared/resources/worklight-jee-library-6.2.0.jar!/conf/core.xml]: Cannot create inner bean 'com.worklight.core.auth.impl.LoginConfigurationServiceBean#16d60e0' of type [com.worklight.core.auth.impl.LoginConfigurationServiceBean] while setting bean property 'loginConfigurationService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.worklight.core.auth.impl.LoginConfigurationServiceBean#16d60e0' defined in URL [wsjar:file:/C:/Users/user/luna-workspace-local/WorklightServerConfig/shared/resources/worklight-jee-library-6.2.0.jar!/conf/core.xml]: Invocation of init method failed; nested exception is java.lang.RuntimeException: FWLSE0249E: conf/authenticationConfig.xml contains duplicated realm named: wl_directUpdateRealm [project myproject]

相关的server.xml配置更改

<administrator-role>
  <user>user</user>
</administrator-role>  

<jndiEntry jndiName="ibm.worklight.admin.jmx.user" value="user"/>
<jndiEntry jndiName="ibm.worklight.admin.jmx.pwd" value="{xor}password"/>

<ldapRegistry baseDN="DC=group,DC=dev,DC=dce,DC=company,DC=com" bindDN="user@dev" bindPassword="{xor}password" host="group.dev.dce.company.com" id="ldap" ignoreCase="true" ldapType="Microsoft Active Directory" port="389" realm="group.dev.dce.company.com:389"><activedFilters groupFilter="(&amp;(cn=%v)(objectcategory=group))" groupIdMap="*:cn" groupMemberIdMap="memberOf:member" userFilter="(&amp;(sAMAccountName=%v)(objectcategory=user))" userIdMap="user:sAMAccountName"/></ldapRegistry>   

<!-- Declare the IBM Worklight Admin Services application. -->
      <application context-root="worklightadmin" id="worklight-management-service" location="worklight-management-service.war" name="WorklightServices" type="war">
        <application-bnd>
          <security-role name="worklightadmin">
            <user name="user"/>
          </security-role>
          <security-role name="worklightdeployer">
      <user name="user"/>
          </security-role>
          <security-role name="worklightmonitor">
      <user name="user"/>
          </security-role>
          <security-role name="worklightoperator">
      <user name="user"/>
          </security-role>
        </application-bnd>
        <classloader delegation="parentLast">
          <privateLibrary>
            <fileset dir="${wlp.install.dir}/lib" includes="com.ibm.ws.crypto.passwordutil*.jar"/>
          </privateLibrary>
        </classloader>
      </application>
      <application context-root="worklightconsole" id="worklight-management-ui" location="worklight-management-ui.war" name="WorklightConsole" type="war">
    <application-bnd>
      <security-role name="worklightadmin">
  <user name="user"/>
      </security-role>
      <security-role name="worklightdeployer">
  <user name="user"/>
      </security-role>
      <security-role name="worklightmonitor">
  <user name="user"/>
      </security-role>
      <security-role name="worklightoperator">
  <user name="user"/>
      </security-role>
    </application-bnd>
  </application>

1 个答案:

答案 0 :(得分:1)

问题在于这一行

<jndiEntry jndiName="ibm.worklight.admin.jmx.pwd" value="{xor}password"/>

这里的密码不应该是{xor}'而是明文

<jndiEntry jndiName="ibm.worklight.admin.jmx.pwd" value="password"/>