【问题标题】:Worklight Push Notification, and SecurityTestWorklight 推送通知和 SecurityTest
【发布时间】:2013-03-02 17:03:56
【问题描述】:

我在我的 iOS 和 Android 项目中使用 Worklight。 我也在使用适配器,进行安全测试,并使用基于适配器的身份验证

我想使用 推送通知,从基于适配器的身份验证功能接收用户 ID。所以我使用相同的 securityTest

现在,当我尝试将我的安全测试与推送事件源一起使用时,出现错误“无法从数据库部署适配器

WL.Server.createEventSource({
    name : 'MyPushEventSource',
    onDeviceSubscribe : 'deviceSubscribeFunc',
    onDeviceUnsubscribe : 'deviceUnsubscribeFunc',
    securityTest : 'MySecurityTest',
});

当我删除最后一行(securityTest)时,适配器被部署,当我添加它时,它失败了。

此 securityTest 已与多个其他适配器函数一起使用。

任何人都可以解释我怎么了? 提前致谢。

编辑:这是我的安全测试定义:

<securityTests>
      <customSecurityTest name="MySecurityTest">
        <test isInternalUserID="true" realm="MyAuthRealm"/>
      </customSecurityTest>
</securityTests>

【问题讨论】:

  • 您能在此处添加安全测试(来自 authenticationConfig.xml)吗?
  • @KerenBaron-Sela 我刚刚编辑了帖子以添加它

标签: push-notification adapter ibm-mobilefirst security-testing


【解决方案1】:

最后,对我有用的解决方案是添加一个新的安全测试,具有相同的领域,类型为 mobileSecurityTest

   <mobileSecurityTest name="MyPushSecurityTest">
        <testUser realm="MyAuthRealm"/>
        <testDeviceId provisioningType="none"/>
    </mobileSecurityTest>

我认为这应该添加到当前的 Worklight 文档中,否则必须打开错误报告。

感谢大家的帮助。

【讨论】:

  • 现在我在添加 poll 时再次出现同样的错误:{ interval : 3, onPoll : gotNotificationFromBackEnd, },
【解决方案2】:

在“server/conf/authenticationConfig.xml”中似乎没有定义“MySecurityTest”,请确保您在那里添加了一个具有此名称的测试:

<securityTests>
    <customSecurityTest name="MySecurityTest">
        <test realm="..." isInternalUserID="..."/>
    </customSecurityTest>
</securityTests>

【讨论】:

  • 安全测试在authenticationConfig.xml中有很好的定义,用于适配器功能没有问题。只有当我为推送事件源添加它时才会出现错误!
  • 您是否尝试过删除适配器并重新部署它?
  • 相同结果:FWLSE0082W:无法从数据库部署适配器(存档:'/var/folders/8p/qylwgy6j2wq4bktw4r5hxqvr0000gp/T/myAdapter5096175866595804426.adapter')。
  • 我以前见过... hrrr... 尝试删除工作区中的 WorklightServerHome 文件夹,然后再次部署应用程序和适配器。看看这个解决方法是否适合你。
  • 我刚试过,它对我不起作用。我有同样的结果。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多