0

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

现在我想将此应用程序传输到 websphere 8.0.0.6 环境,但是当我这样做时,我在目录日志中收到此消息:

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 文件。我可以看到部署在我的工作灯控制台中的所有文件,并且我的 android 应用程序正确连接到工作灯服务器

在这个 .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, {});
};

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

4

1 回答 1

1

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

于 2013-08-28T16:29:35.170 回答