Ibm mobilefirst 将Worklight应用程序部署到生产环境

Ibm mobilefirst 将Worklight应用程序部署到生产环境,ibm-mobilefirst,Ibm Mobilefirst,我用worklight6.0.0开发了一个worklight应用程序,它有一些http适配器,可以与eclipse中的liberty配置文件配合使用 现在,我想将此应用程序传输到websphere 8.0.0.6环境,但当我这样做时,我在catlog中收到以下消息: info: {"challenges":{"wl_antiXSRFRealm":{"WL-Instance-Id":"ajjqfhmo88gqmm955r2p22vq7j"}}}*/ error: defaultOptions:o

我用worklight6.0.0开发了一个worklight应用程序,它有一些http适配器,可以与eclipse中的liberty配置文件配合使用

现在,我想将此应用程序传输到websphere 8.0.0.6环境,但当我这样做时,我在catlog中收到以下消息:

info: {"challenges":{"wl_antiXSRFRealm":{"WL-Instance-Id":"ajjqfhmo88gqmm955r2p22vq7j"}}}*/

error: defaultOptions:onFailure Procedure invocation error.
这是另一个错误:

[Http://190.246.205.5:9081/WorklightPocProj/apps/services/../../invoke] failure. state: 500, response: The server was unable to process the request from the application. Please try again later.

defaultOptions:onFailure The server was unable to process the request from the application. Please try again later.
我在wlinit上调用了一个虚拟适配器,响应正确,应用程序给我的这个错误发生在我调用这个方法之后:

submitAdapterAuthentication(invocationData,{})

因此,我更改了worklight.properties并重新部署了.war,然后在WAS上部署了.war并安装了all.wlapp和所有.adapter文件。 我可以看到worklight控制台中部署的所有文件,并且我的android应用程序正确连接到worklight服务器

在这个.war中,我有另一个应用程序(一个facebook应用程序),它没有任何适配器,工作正常

这是我的代码领域:

<securityTests>
    <!-- 
    <customSecurityTest name="WorklightConsole">
        <test realm="WorklightConsole" isInternalUserID="true"/>
    </customSecurityTest>

    <mobileSecurityTest name="mobileTests">
        <testAppAuthenticity/> 
        <testDeviceId provisioningType="none" />
        <testUser realm="myMobileLoginForm" />
    </mobileSecurityTest>

    <webSecurityTest name="webTests">
        <testUser realm="myWebLoginForm"/>
    </webSecurityTest>

    <customSecurityTest name="customTests">
        <test realm="wl_antiXSRFRealm" step="1"/>
        <test realm="wl_authenticityRealm" step="1"/>
        <test realm="wl_remoteDisableRealm" step="1"/>
        <test realm="wl_anonymousUserRealm" isInternalUserID="true" step="1"/>
        <test realm="wl_deviceNoProvisioningRealm" isInternalDeviceID="true" step="2"/>
    </customSecurityTest>
    -->
    <customSecurityTest name="SubscribeServlet">
        <test realm="SubscribeServlet" isInternalUserID="true"/>
    </customSecurityTest> 
    <customSecurityTest name="SimpleAuthAdapterTest">
        <test realm="SimpleAuthRealm" isInternalUserID="true" />

    </customSecurityTest>       

</securityTests> 

<realms>
    <realm name="SampleAppRealm" loginModule="StrongDummy">
        <className>com.worklight.core.auth.ext.FormBasedAuthenticator</className>
    </realm>

    <realm name="WorklightConsole" loginModule="requireLogin">
        <className>com.worklight.core.auth.ext.FormBasedAuthenticator</className>
        <onLoginUrl>/console</onLoginUrl>
    </realm>
    <realm name="SimpleAuthRealm" loginModule="SimpleAuthLoginModule">
        <className>com.worklight.integration.auth.AdapterAuthenticator</className>
        <parameter name="login-function" value="SimpleAuthAdapter.onAuthRequired" />
        <parameter name="logout-function" value="SimpleAuthAdapter.onLogout" />
    </realm>
    <realm name="SubscribeServlet" loginModule="rejectAll">
        <className>com.worklight.core.auth.ext.HeaderAuthenticator</className>          
    </realm>
    <!-- For websphere -->
    <!-- realm name="WASLTPARealm" loginModule="WASLTPAModule">
        <className>com.worklight.core.auth.ext.WebSphereFormBasedAuthenticator</className>
        <parameter name="login-page" value="/login.html"/>
        <parameter name="error-page" value="/loginError.html"/>
    </realm -->
</realms>

<loginModules>
<loginModule name="SimpleAuthLoginModule">
        <className>com.worklight.core.auth.ext.NonValidatingLoginModule</className>
    </loginModule>
    <loginModule name="StrongDummy">
        <className>com.worklight.core.auth.ext.NonValidatingLoginModule</className>
    </loginModule>

    <loginModule name="requireLogin">
        <className>com.worklight.core.auth.ext.SingleIdentityLoginModule</className>
    </loginModule>

    <loginModule name="rejectAll">
        <className>com.worklight.core.auth.ext.RejectingLoginModule</className>
    </loginModule>

    <!-- For websphere -->
    <!-- loginModule name="WASLTPAModule">
        <className>com.worklight.core.auth.ext.WebSphereLoginModule</className>
    </loginModule -->

    <!-- For enabling SSO with no-provisioning device authentication -->
    <!-- <loginModule name="MySSO" ssoDeviceLoginModule="WLDeviceNoProvisioningLoginModule">
        <className>com.worklight.core.auth.ext.NonValidatingLoginModule</className>
    </loginModule> -->
    <!-- For enabling SSO with auto-provisioning device authentication -->
    <!-- <loginModule name="MySSO" ssoDeviceLoginModule="WLDeviceAutoProvisioningLoginModule">
        <className>com.worklight.core.auth.ext.NonValidatingLoginModule</className>
    </loginModule> -->
</loginModules>

是否有我遗漏的内容或我做错了什么?

已解决:发生此错误的原因是was服务器上启用了应用程序安全性,而没有在web.xml文件上设置任何角色

var handler = WL.Client.createChallengeHandler("SimpleAuthRealm");
var busyInd;
function login() {
busyInd = new WL.BusyIndicator('content', {
    text : 'Verificando credenciales...'
});
busyInd.show();

var username = $('#AuthUsername').val();
var password = $('#AuthPassword').val();
usuario1 = username;
password1 = password;
var invocationData = {
    adapter : "SimpleAuthAdapter",
    procedure : "submitAuthentication",
    parameters : [ "Basic " + Base64.encode(username + ":" + password),
            username ]
};

handler.submitAdapterAuthentication(invocationData, {});
};