【发布时间】:2013-08-08 18:37:24
【问题描述】:
我一直在尝试实施和测试 Worklight 的应用程序真实性功能,但未能成功。我已经查看了该站点上的每个帖子,以及 WL 信息中心的信息,但没有成功。我正在详细解释我所做的事情以及我看到的结果,希望有人能够帮助我。
环境: 安装在 Windows 7 Enterprise 上的 Worklight Studio 5.0.5 消费者版 安装在 Windows 7 Enterprise 上的 Worklight Server 5.0.5 消费者版
WL Server 正在 Worklight Server 安装提供的 Websphere Application Server Liberty 配置文件中运行
WL Server 正在使用安装包提供的 derby 数据库。
实施步骤:
-
在 authenticationConfig.xml 中添加(取消注释)安全测试
<mobileSecurityTest name="mobileTests"> <testDeviceId provisioningType="none"/> <testAppAuthenticity/> <testUser realm="wl_anonymousUserRealm"/> </mobileSecurityTest> 重建 .war 文件并将其部署到 Worklight Server。
修改 initOptions.js 使“connectOnStartup : true”
-
修改application-descriptor.xml,指定Android应用的安全测试,添加publicSigningKey
<android version="1.1" securityTest="mobileTests"> <worklightSettings include="false"/> <security> <encryptWebResources enabled="false"/> <testWebResourcesChecksum enabled="false" ignoreFileExtensions="png, jpg, jpeg, gif, mp4, mp3"/> <publicSigningKey>.......</publicSigningKey> </security> 重新构建应用程序并将其部署到 WL 服务器。
创建签名的.apk文件并上传到应用中心。
在物理设备上安装应用程序(Samsung Galaxy Tab 2,Android 4.1.1)
启动应用程序。
当我从 WL 控制台或在物理设备上以“预览”模式启动应用程序时,我最终会显示相同的错误。我收到的错误是:
{"errorCode":"UNEXPECTED_ERROR","errorMsg":"userIdentityForAPI 为空。检查您的应用程序的身份验证要求(never、onStartup、onDemand)。这些设置必须与部署的应用程序匹配"}
我的配置中有什么遗漏吗?
【问题讨论】:
-
WL 6.0.1 中的同样问题:
Nov 4, 2013 2:21:53 PM com.worklight.gadgets.serving.GadgetAPIServlet doGetOrPost WARNING: FWLSE0009W: User identity is null. Check your application''s authentication requirements. These settings must match to the deployed application [project wlm] Nov 4, 2013 2:21:53 PM com.worklight.gadgets.serving.GadgetAPIServlet createAjaxRequestExceptionJSON SEVERE: FWLSE0020E: Ajax request exception: FWLSE0009W: User identity is null. Check your application''s authentication requirements. These settings must match to the deployed application [project wlm] [project wlm] -
@Jim,如果此问题已解决,请将其标记为已回答。
标签: android ibm-mobilefirst worklight-security