2

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>
WiPhone
  • 683
  • 6
  • 24

2 Answers2

2

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.

WiPhone
  • 683
  • 6
  • 24
  • Now I am gestting again the same error when I add poll : { interval : 3, onPoll : gotNotificationFromBackEnd, }, – WiPhone Mar 16 '13 at 09:29
0

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>
Pavel Leonov
  • 346
  • 1
  • 11
  • The security test is well defined in authenticationConfig.xml, and used with no problem for the adapter functions. The error comes only when I add it for the push event source! – WiPhone Mar 14 '13 at 15:45
  • Have you tried deleting your adapter and deploying it freshly? – Idan Adar Mar 14 '13 at 18:53
  • Same result : FWLSE0082W: Failed to deploy adapter from the database (archive: '/var/folders/8p/qylwgy6j2wq4bktw4r5hxqvr0000gp/T/myAdapter5096175866595804426.adapter'). – WiPhone Mar 14 '13 at 20:09
  • I have seen it before... hrrr... try deleting the WorklightServerHome folder in your workspace and deploy both app and adapter again. See if this workaround works for you. – Idan Adar Mar 15 '13 at 03:50
  • I've just tried it, it does not work for me. I have the same result. – WiPhone Mar 15 '13 at 08:00