I have two adapters, a SQL adapter and a push adapter. Both adapters deploy without errors. I (think) I would like to use one security realm. I have defined two security-tests using the same realm: one for the protected SQL calls and one for the push adapter. My authenticationConfig.xml looks like this
<securityTests> <customSecurityTest name= "mychAdapter-securityTest"> <test isInternalUserID= "true" realm= "mychAuthRealm"/> </customSecurityTest> <mobileSecurityTest name= "push-securityTest"> <testUser realm= "mychAuthRealm"/> <testDeviceId provisioningType= "none"/> </mobileSecurityTest> </securityTests> <realms> <realm name= "mychAuthRealm" loginModule= "mychAuthLoginModule"> <className>com.worklight.integration.auth.AdapterAuthenticator</className> <parameter name= "login-function" value= "mychAdapter.onAuthRequired"/> <parameter name= "logout-function" value= "mychAdapter.onLogout"/> </realm> </realms> <loginModules> <loginModule name= "mychAuthLoginModule"> <className>com.worklight.core.auth.ext.NonValidatingLoginModule</className> </loginModule> </loginModule --> </loginModules>
I read that the onReadyToSubscribe event fires when the user is authenticated. When the user is authenticated (based on the customSecurityTest) the event does not fire. I do not understand why. When I try to subscribe anyway I see an error "Can't subscribe, notification token is not updated on server".
My aim is to have the user only authenticate once. When he is authenticated he should be able to subscribe to push notifications.
So, what is the best way to get this done?
Thanks for your time!