IBM MobileFirst 服务器 7.1 PushNotification 订阅者 ID(USERID) 未存储

Posted

技术标签:

【中文标题】IBM MobileFirst 服务器 7.1 PushNotification 订阅者 ID(USERID) 未存储【英文标题】:IBM MobileFirst server 7.1 PushNotification Subscriber ID(USERID) Not stored 【发布时间】:2015-11-04 15:17:39 【问题描述】:

我在 IBM MobileFirst 7.1 推送通知中遇到问题SubscriberID(USERID)

我已在 MobileFirst 服务器 7.1 Liberty 配置文件中成功部署推送通知示例应用程序

我配置了WRKLGHT数据库来存储pushdevicessubscriber id

虽然登录过程 USERID 未存储在设备表中。在该设备表中,USERID 字段存储为 NUL。结果 USERID 未显示在 设备标签 移动优先控制台中。

GCM pushsenderkey 和 pushsenderid 在 application-descriptor.xml 文件中正确配置

worklight.properties中设置以下两个属性

wl.device.tracking.enabled=true
wl.device.enableAccessManagement=true

application-descriptor.xml

<userIdentityRealms>PushAppRealm</userIdentityRealms>

我在我的authenticationConfig.xml 中进行了以下配置以确保真实性

 <?xml version="1.0" encoding="UTF-8"?>
<tns:loginConfiguration xmlns:tns="http://www.worklight.com/auth/config"     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<!--
  COPYRIGHT LICENSE: This information contains sample code provided in source code form. You may copy, modify, and distribute
these sample programs in any form without payment to IBM® for the purposes of developing, using, marketing or distributing
application programs conforming to the application programming interface for the operating platform for which the sample code is written.
Notwithstanding anything to the contrary, IBM PROVIDES THE SAMPLE SOURCE CODE ON AN "AS IS" BASIS AND IBM DISCLAIMS ALL WARRANTIES,
EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, ANY IMPLIED WARRANTIES OR CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY,
FITNESS FOR A PARTICULAR PURPOSE, TITLE, AND ANY WARRANTY OR CONDITION OF NON-INFRINGEMENT. IBM SHALL NOT BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR OPERATION OF THE SAMPLE SOURCE CODE.
IBM HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS OR MODIFICATIONS TO THE SAMPLE SOURCE CODE.
    -->


     <staticResources>
        <!--  
        <resource id="logUploadServlet" securityTest="LogUploadServlet">
            <urlPatterns>/apps/services/loguploader*</urlPatterns>
        </resource>
        -->
           <resource id="subscribeServlet" securityTest="SubscribeServlet">
              <urlPatterns>/subscribeSMS*;/receiveSMS*;/ussd*</urlPatterns>
           </resource>
       </staticResources>
    <!--  Sample security tests  
         Even if not used there will be some default webSecurityTest and           mobileSecurityTest 

         Attention: If you are adding an app authenticity realm to a security test, 
         you must also update the application-descriptor.xml. Please refer to the user documentation 
         on application authenticity for environment specific guidelines. -->
    <securityTests>
        <!-- 
        <mobileSecurityTest name="mobileTests">
            <testAppAuthenticity/> 
            <testDeviceId provisioningType="none" />
            <testUser realm="myMobileLoginForm" />
            <testDirectUpdate mode="perSession" />
        </mobileSecurityTest>

        <webSecurityTest name="webTests">
            <testUser realm="myWebLoginForm"/>
        </webSecurityTest>

        <customSecurityTest name="customTests">
            <test realm="wl_antiXSRFRealm" step="1"/>
            <test realm="wl_authenticityRealm" step="1"/>
            <test realm="wl_remoteDisableRealm" step="1"/>
            <test realm="wl_directUpdateRealm" mode="perSession" step="1"/>
            <test realm="wl_anonymousUserRealm" isInternalUserID="true" step="1"/>
            <test realm="wl_deviceNoProvisioningRealm" isInternalDeviceID="true" step="2"/>
        </customSecurityTest>

        <customSecurityTest name="LogUploadServlet">
            <test realm="wl_anonymousUserRealm" step="1"/>
            <test realm="LogUploadServlet" isInternalUserID="true"/>
        </customSecurityTest>
        -->
        <webSecurityTest name="PushApplication-web-securityTest">
            <testUser realm="PushAppRealm"/>
        </webSecurityTest>
        <mobileSecurityTest name="PushApplication-strong-mobile-securityTest">
            <testUser realm="PushAppRealm"/>
            <testDeviceId provisioningType="none"/>
        </mobileSecurityTest>
        <customSecurityTest name="SubscribeServlet">
            <test realm="wl_directUpdateRealm" step="1"/>
            <test isInternalUserID="true" realm="SubscribeServlet"/>
        </customSecurityTest>
    </securityTests>
    <realms>
        <realm loginModule="StrongDummy" name="SampleAppRealm">
            <className>com.worklight.core.auth.ext.FormBasedAuthenticator</className>
        </realm>
        <realm loginModule="rejectAll" name="SubscribeServlet">
            <className>com.worklight.core.auth.ext.HeaderAuthenticator</className>
        </realm>
        <!-- For client logger -->
        <!-- <realm name="LogUploadServlet" loginModule="StrongDummy">
            <className>com.worklight.core.auth.ext.HeaderAuthenticator</className>
        </realm -->
        <!-- For websphere -->
        <!-- realm name="WASLTPARealm" loginModule="WASLTPAModule">
            <className>com.worklight.core.auth.ext.WebSphereFormBasedAuthenticator</className>
            <parameter name="login-page" value="/login.html"/>
            <parameter name="error-page" value="/loginError.html"/>
        </realm -->
        <!-- For User Certificate Authentication -->
        <!-- realm name="wl_userCertificateAuthRealm" loginModule="WLUserCertificateLoginModule">
            <className>com.worklight.core.auth.ext.UserCertificateAuthenticator</className>
            <parameter name="dependent-user-auth-realm" value="WASLTPARealm" />
            <parameter name="pki-bridge-class" value="com.worklight.core.auth.ext.UserCertificateEmbeddedPKI" />
            <parameter name="embedded-pki-bridge-ca-p12-file-path" value="/opt/ssl_ca/ca.p12"/> 
            <parameter name="embedded-pki-bridge-ca-p12-password" value="capassword" />
        </realm -->
        <!-- For Trusteer Fraud Detection -->
        <!-- Requires acquiring Trusteer SDK -->
        <!-- realm name="wl_basicTrusteerFraudDetectionRealm" loginModule="trusteerFraudDetectionLogin">


<className>com.worklight.core.auth.ext.TrusteerAuthenticator</className>


 <parameter name="rooted-device" value="block"/>
            <parameter name="device-with-malware" value="block"/>
            <parameter name="rooted-hiders" value="block"/>
            <parameter name="unsecured-wifi" value="alert"/>
            <parameter name="outdated-configuration" value="alert"/>
        </realm -->
        <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>
        <loginModule name="StrongDummy">


<className>com.worklight.core.auth.ext.NonValidatingLoginModule</className>
        </loginModule>
        <loginModule name="requireLogin">


<className>com.worklight.core.auth.ext.SingleIdentityLoginModule</className>
        </loginModule>
        <loginModule name="rejectAll">


<className>com.worklight.core.auth.ext.RejectingLoginModule</className>
        </loginModule>
        <!-- Required for Trusteer - wl_basicTrusteerFraudDetectionRealm -->
        <!-- loginModule name="trusteerFraudDetectionLogin">


<className>com.worklight.core.auth.ext.TrusteerLoginModule</className>
        </loginModule-->
        <!-- For websphere -->
        <!-- loginModule name="WASLTPAModule">


<className>com.worklight.core.auth.ext.WebSphereLoginModule</className>
        </loginModule -->
        <!-- Login module for User Certificate Authentication -->
        <!-- <loginModule name="WLUserCertificateLoginModule">





<className>com.worklight.core.auth.ext.NonValidatingLoginModule</className>
        </loginModule> -->
        <!-- For enabling SSO with auto-provisioning device authentication -->
        <!-- <loginModule name="MySSO" ssoDeviceLoginModule="WLDeviceAutoProvisioningLoginModule">


<className>com.worklight.core.auth.ext.NonValidatingLoginModule</className>
        </loginModule> -->
    </loginModules>
</tns:loginConfiguration>

MobileFirst 控制台

设备数据库表

【问题讨论】:

推送订阅未存储在 DEVICES 表中。您似乎混合了很多东西 - 推送、用户登录、设备管理等。您能否更具体地说明问题是什么? 要填充用户标识,必须有成功的用户身份验证。您使用哪个 MFP 7.1 推送示例进行测试 无法使用 EventSourceNotifications 示例在 7.0 或 7.1 上重新创建问题。确定通知成功后刷新页面了吗? @rajprabhu 请不要让您的问题无人回答:要么写下以上内容作为答案,要么删除问题。 回答:它适用于我..我犯了一个错误...在一个版本中开发的应用程序部署在另一个修复包版本中..谢谢 Vivin K,Idan... 【参考方案1】:

这是由于用户错误而发生的:

它对我有用..我犯了一个错误...在一个版本中开发将应用程序部署在另一个修复包版本中

【讨论】:

以上是关于IBM MobileFirst 服务器 7.1 PushNotification 订阅者 ID(USERID) 未存储的主要内容,如果未能解决你的问题,请参考以下文章

IBM MobileFirst 7.1 - 本地服务器复制资源

如何使用 IBM MobileFirst 7.1 实现文件下载?

设置 IBM Mobilefirst 7.1 时无法使用服务器配置工具部署服务器配置

从 WL6.3 迁移后,Android 中的 IBM MobileFirst 7.1 服务器连接失败

我的基于 IBM MobileFirst Platform 7.1 CLI 的服务器存在一些问题;我怎样才能轻松地重新创建它?

IBM MobileFirst CLI 7.1 旧版本