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

时间:2013-08-26 20:03:17

标签: ibm-mobilefirst

我用worklight6.0.0做了一个worklight应用程序,它有一些http适配器可以在eclipse中使用我的自由配置文件。

现在我想将此应用程序传输到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上调用了一个虚拟适配器并且响应正确,应用程序给我的这个错误发生在我调用此方法之后:

handler.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>

这是我的ChallengeHandler代码的一部分:

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, {});
};

我有什么遗漏或者我做错了吗?

1 个答案:

答案 0 :(得分:1)

解决:发生此错误是因为在服务器上启用了应用程序安全性而未在web.xml文件上设置任何角色。