I am using Worklight in my iOS and Android Project. I am also using adapters, with on security test, and using adapter based authentication.

I want to use push notifications, with users ids recieved from adapter based authentication function. So I use the same securityTest.

Now when I try to use my security test with the push event source, I have an error "Failed to deploy adapter from the database"

WL.Server.createEventSource({
    name : 'MyPushEventSource',
    onDeviceSubscribe : 'deviceSubscribeFunc',
    onDeviceUnsubscribe : 'deviceUnsubscribeFunc',
    securityTest : 'MySecurityTest',
});

When I remove the last line (securityTest), the adapter is deployed, when I add it, it fail.

This securityTest is already used with multiple other adapter functions.

Any one can explain me what's wrong ? Thanks in advance.

edit: Here is my security test definition:

<securityTests>
      <customSecurityTest name="MySecurityTest">
        <test isInternalUserID="true" realm="MyAuthRealm"/>
      </customSecurityTest>
</securityTests>
有帮助吗?

解决方案

Finally, The solution that worked for me is Adding a new security test, with the same realm, and with type mobileSecurityTest

   <mobileSecurityTest name="MyPushSecurityTest">
        <testUser realm="MyAuthRealm"/>
        <testDeviceId provisioningType="none"/>
    </mobileSecurityTest>

I think that this should be added to the current Worklight documentation, or a bug report must be opened.

Thank you all for your help.

其他提示

It seems like there is no 'MySecurityTest' defined in 'server/conf/authenticationConfig.xml', be sure that you added there a test with this name:

<securityTests>
    <customSecurityTest name="MySecurityTest">
        <test realm="..." isInternalUserID="..."/>
    </customSecurityTest>
</securityTests>
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top