2014-02-13 63 views
0

Worklight PushAdapter示例在开发env(即worklight studio)中工作正常,但在转移到生产时会发生夫妇问题。生产环境中的Worklight PushAdapter问题

  1. 由于安全问题,后端应用程序无法调用推送过程。如果设置为securityTest="wl_unprotected",这可能是生产风险,还有其他解决方案?

  2. onPoll函数eventSource,如果调用其他适配器的过程,它也会在生产中提高安全性问题,虽然在dev中工作正常。

例如,

PushAdapter:

WL.Server.createEventSource({ 
    name: 'PushEventSource', 
    onDeviceSubscribe: 'deviceSubscribeFunc', 
    onDeviceUnsubscribe: 'deviceUnsubscribeFunc', 
    securityTest:'SingleStepAuthAdapter-securityTest', 
    poll:{ 
     interval: 120, 
     onPoll: 'getNotificationFromBackend' 
    } 
}); 


function getNotificationFromBackend(){ 
var notifications = WL.Server.invokeProcedure({ 
     adapter : 'MessageAdapter', 
     procedure : 'getMessages', 
     parameters : [] 
    }); 

    WL.Logger.error("notifications: " + JSON.stringify(notifications)); 

... 
} 


Error Messages: 
[14-2-13 9:11:45:382 CST] 0000003d ht.integration.js.JavaScriptIntegrationLibraryImplementation E notifications: {"isSuccessful":false,"errors":["Runtime: The resource 'proc:MessageAdapter.getMessages' should only be accessed when authenticated in realm 'wl_antiXSRFRealm'."],"warnings":[],"info":[]} [project XXX] 

你能帮助请?先谢谢了。

回答

0

工作灯应该允许被分配到推适配器是由企业防火墙保护的监听端口号。如果这种功能存在,那么它应该只是在生产环境中配置防火墙,以便仅允许来自特定推送源的推送请求。

如果这样的功能不可用,那么推送适配器应该受到安全测试的保护。在推送数据时,推送源应使用特殊的登录ID进行身份验证。这应该是可行的。