Push notification 更改身份验证的安全测试时,Android设备不会收到推送通知

Push notification 更改身份验证的安全测试时,Android设备不会收到推送通知,push-notification,ibm-mobilefirst,Push Notification,Ibm Mobilefirst,我正在开发一个混合应用程序,并且正在实现Android设备的MobileFirst Platform入门页面示例代码中提供的推送通知过程。正如本教程中所述,设备和用户对推送通知服务的订阅只能在身份验证之后进行。在authenticationConfig.xml文件中使用以下安全测试时,效果良好: 案例1: <securityTests> <mobileSecurityTest name="PushApplication-strong-mobile-securityTes

我正在开发一个混合应用程序,并且正在实现Android设备的MobileFirst Platform入门页面示例代码中提供的推送通知过程。正如本教程中所述,设备和用户对推送通知服务的订阅只能在身份验证之后进行。在authenticationConfig.xml文件中使用以下安全测试时,效果良好:

案例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>
但是,应用程序已经使用SingleStepAuthRealm进行身份验证,因此在authenticationConfig.xml文件中使用以下安全测试时,我们面临一个问题:

<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>
在这种情况下,订阅已正确完成。我们可以在服务器中看到用户和设备已订阅。甚至,当我们调用PushAdapter中的submitNotificationuserId、notificationText以及对WL.Server.notifyAllDevicesuserSubscription的调用时,通知已成功完成,并且我们获得了将通知发送给用户的结果。此外,如果我们调用WL.Server.getUserNotificationSubscription和getDeviceSubscriptions方法,则订阅的用户和设备将收到正确的信息

我们面临的问题是,订阅的设备从未收到推送通知。尽管没有发生错误,但消息永远不会发送到推送通知中介

在推送通知之前,authenticationConfig.xml中用于验证用户的安全测试是否会有所不同


提前非常感谢

最后,我再次添加了来自environment节点的安全测试,它可以很好地接收推送通知。所使用的域对推送通知的接收没有影响。

您是否更新了质询处理程序以使用SingleStepAuthRealm?我们没有更新SingleStepAuthRealm处理程序,并且与示例中使用的处理程序不同。此外,我们还必须从application-desciptor.xml中删除该行,因为该行强制在启动应用程序后调用处理程序,并且我们希望在提交凭据后使用SingleStepAuthRealm调用处理程序。?这会影响推送通知的接收吗?非常感谢您,并对延迟表示抱歉。最后,我再次添加了来自环境节点的安全测试,它可以很好地接收推送通知。所使用的领域对推送通知的接收没有影响。