2015-02-05 68 views
1

我有應用程序部署在worklight 6.2,我想禁用從authenticationConfig.xml直接更新。 我customSecurityTest看起來像這樣:在Worklight 6.2上禁用直接更新不起作用?

<customSecurityTest name="SubscribeServlet"> 
    <test realm="wl_directUpdateRealm" mode="disabled" step="0"/> 
    <test isInternalUserID="true" realm="SubscribeServlet" /> 
</customSecurityTest> 
<customSecurityTest name="AdapterSecurityTest"> 
    <test realm="wl_directUpdateRealm" mode="disabled" step="0"/> 
    <test isInternalUserID="true" realm="AdapterAuthRealm" /> 
</customSecurityTest> 

但還是起步時更新應用程序檢查。模式已禁用似乎無法正常工作。

+0

IOS?的android? Windows手機? – 2015-02-05 13:34:33

+0

我使用的是Android平臺, 服務器版本:6.2.0.00.20140613-0730 – Balflear 2015-02-05 13:36:49

回答

3

更新:我已經仔細檢查了這一點,它工作正常。

我使用工作燈6.2.0.01-20150102-1548
步驟我已經採取了:

  1. 創建一個新的項目和應用程序,並增加了Android環境
  2. 添加以下自定義安全測試服務器\的conf \ authenticationConfig.xml:

    <customSecurityTest name="customTests"> 
         <test realm="wl_antiXSRFRealm" step="1"/> 
         <test realm="wl_remoteDisableRealm" step="1"/> 
         <test realm="wl_directUpdateRealm" mode="perSession" step="1"/> 
         <test realm="wl_anonymousUserRealm" isInternalUserID="true" step="1"/> 
    
  3. 應用的安全測試環境中的應用程序\我的應用程序內\應用-descriptor.xml:

    <android version="1.0" securityTest="customTests"> 
         <test realm="wl_deviceNoProvisioningRealm" isInternalDeviceID="true" step="2"/> 
        </customSecurityTest> 
    
  4. 添加常用\ JS \ main.js,在wlCommonInit()

    function wlCommonInit(){ 
        WL.Client.connect({onSuccess: function() {alert("success");}, onFailure: function() {alert("failure");}}); 
    } 
    
  5. 運行方式>工作燈開發服務器

  6. 運行方式>的Android上運行應用程序

應用程序成功連接到服務器

  1. 更改main.js以顯示另一個警報。退出應用程序並重新打開它

顯示第二個提醒。

  • 改變了警報文本到一些其他文本
  • 在authenticationConfig.xml改模式從perSessiondisabled和保存文件
  • 的儲蓄可確保服務器將這些更改考慮在內。
    如果您使用遠程服務器(而不是開發服務器),您必須重新部署.war和.wlapp文件以應用更改(!)。

  • 退出應用程序,並重新打開它
  • 沒有直接更新請求進來,並顯示在同一先前的第二警報文本。

    還通過將模式從disabled更改爲perSession再次驗證。退出應用程序並重新打開它 - 更新後的警報隨即顯示在Direct Update請求之後。


    以下安全測試名稱暗示我這是一個安全測試,您已將其放在適配器過程中。

    <customSecurityTest name="AdapterSecurityTest"> 
    

    這不會使應用程序未收到應用程序啓動時直接更新 - 因爲你沒有把這個安全測試的環境,因此在啓動時不制定。您只將它放在適配過程中(僅在WL.Client.invokeProcedure ...中調用)。

    你還必須保護環境本身。添加其他定製「我的安全測試」,並把它的環境的節點上的應用程序descriptor.xml

    例如:

    <android version="1.0" securityTest="my-security-test"> 
    
    +0

    thx快速回復,但我仍然無法禁用直接更新,我會告訴你我的配置文件application-descriptor.xml的一些部分和authenticationConfix.xml **應用descriptor.xml:** '<機器人版本= 「1.0」 securityTest = 「我的安全測試」>' ** authenticationConfix.xml:** ' \t \t <測試境界= 「wl_directUpdateRealm」 模式= 「禁用」 步驟= 「1」/> \t \t <測試境界= 「wl_anonymousUserRealm」 isInternalUserID =「TR UE」步驟= 「1」/> \t \t <測試境界= 「wl_deviceNoProvisioningRealm」 isInternalDeviceID = 「真」 步驟= 「2」/> \t' – Balflear 2015-02-05 14:58:19

    +0

    這並不似乎工作。我創建了一個customSecurityTest,並在application-descriptor.xml中定義... – Balflear 2015-02-05 15:46:57

    +0

    @Balflear,查看我更新的答案。這工作正常。 – 2015-02-05 17:32:54