I'm developing an hybrid application and I'm implementing the push notification procedure provided in the sample code of the MobileFirst Platform "Getting Started" page for an Android device. As it is said in the tutorial, the device and user subscription to the push notification service can only take place after authentication. When using the following security test in the authenticationConfig.xml file it works fine:
Case 1:
<securityTests>
<mobileSecurityTest name="PushApplication-strong-mobile-securityTest">
<testUser realm="PushAppRealm"/>
<testDeviceId provisioningType="none"/>
</mobileSecurityTest>
</securityTests>
<realms>
<realm loginModule="PushAppLoginModule" name="PushAppRealm">
<className>com.worklight.core.auth.ext.FormBasedAuthenticator</className>
</realm>
</realms>
<loginModules>
<loginModule name="PushAppLoginModule">
<className>com.worklight.core.auth.ext.NonValidatingLoginModule</className>
</loginModule>
</loginModules>
However the application already was using a SingleStepAuthRealm for authenticating so when using the following security test in the authenticationConfig.xml file we are facing an issue:
<securityTests>
<mobileSecurityTest name="PushApplication-strong-mobile-securityTest">
<testUser realm="SingleStepAuthRealm"/>
<testDeviceId provisioningType="none"/>
</mobileSecurityTest>
</securityTests>
<realms>
<realm loginModule="AuthLoginModule" name="SingleStepAuthRealm">
<className>com.worklight.integration.auth.AdapterAuthenticator</className>
<parameter name="login-function" value="SingleStepAuthAdapter.onAuthRequired"/>
<parameter name="logout-function" value="SingleStepAuthAdapter.onLogout"/>
</realm>
</realms>
<loginModules>
<loginModule name="AuthLoginModule">
<className>com.worklight.core.auth.ext.NonValidatingLoginModule</className>
</loginModule>
</loginModules>
In this case, the subscription is done correctly. We can see in the server that the user and the device is subscribed. Even, when we invoke the submitNotification(userId, notificationText) in the PushAdapter the call to WL.Server.notifyAllDevices(userSubscription, notification) is completed successfully and we are obtaining as a result that the Notification was sent to user. Also if we invoke the WL.Server.getUserNotificationSubscription and the getDeviceSubscriptions() methods the correct information is received abut the subscribed user and the device.
The problem that we are facing is that the subscribed device never receives the push notification. The message is never sent to the push notification mediator although no error is occurring.
Does it make a difference the security test used in the authenticationConfig.xml for authenticating the user before the push notifications?
Thanks very much in advance