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.