2016-04-21 36 views
0

我想在MobileFirst 7.0服务器上为Android应用程序禁用自动更新。我已经尝试在这里介绍的方法:在MobileFirst服务器上禁用自动更新

IBM MobileFirst 7.0 - How to disable auto-update

这里

https://www.ibm.com/support/knowledgecenter/SSHS8R_7.1.0/com.ibm.worklight.dev.doc/admin/c_direct_update_as_security_realm.html?lang=en

,但没有运气。

我原来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"> 

     <!-- Licensed Materials - Property of IBM 
      5725-I43 (C) Copyright IBM Corp. 2006, 2013. All Rights Reserved. 
      US Government Users Restricted Rights - Use, duplication or 
      disclosure restricted by GSA ADP Schedule Contract with IBM Corp. --> 

    <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> 
     --> 
     <customSecurityTest name="SubscribeServlet"> 
      <test realm="SubscribeServlet" isInternalUserID="true"/> 
     </customSecurityTest>   

    </securityTests> 

    <realms> 
     <realm name="SampleAppRealm" loginModule="StrongDummy"> 
      <className>com.worklight.core.auth.ext.FormBasedAuthenticator</className> 
     </realm> 

     <realm name="SubscribeServlet" loginModule="rejectAll"> 
      <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 --> 

    </realms> 

    <loginModules> 
     <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.UserCertificateLoginModule</className> 
     </loginModule> --> 


     <!-- For enabling SSO with no-provisioning device authentication --> 
     <!-- <loginModule name="MySSO" ssoDeviceLoginModule="WLDeviceNoProvisioningLoginModule"> 
      <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> 

多次试验后,我这个结束:

<?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"> 

     <!-- Licensed Materials - Property of IBM 
      5725-I43 (C) Copyright IBM Corp. 2006, 2013. All Rights Reserved. 
      US Government Users Restricted Rights - Use, duplication or 
      disclosure restricted by GSA ADP Schedule Contract with IBM Corp. --> 

    <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="disabled" /> 
     </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="disabled" 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> 
     --> 

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

     <customSecurityTest name="SampleAppRealm"> 
      <test realm="wl_directUpdateRealm" mode="disabled" step="1"/> 
      <test realm="SampleAppRealm" isInternalUserID="true"/> 
     </customSecurityTest> 

     <mobileSecurityTest name="mobileTests"> 
      <testDirectUpdate mode="disabled"/> 
      <testDeviceId provisioningType="none"></testDeviceId> 
      <testUser realm="wl_anonymousUserRealm"></testUser> 
     </mobileSecurityTest> 

    </securityTests> 

    <realms> 
     <realm name="SampleAppRealm" loginModule="StrongDummy"> 
      <className>com.worklight.core.auth.ext.FormBasedAuthenticator</className> 
     </realm> 

     <realm name="SubscribeServlet" loginModule="rejectAll"> 
      <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 --> 

    </realms> 

    <loginModules> 
     <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.UserCertificateLoginModule</className> 
     </loginModule> --> 


     <!-- For enabling SSO with no-provisioning device authentication --> 
     <!-- <loginModule name="MySSO" ssoDeviceLoginModule="WLDeviceNoProvisioningLoginModule"> 
      <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> 

,但它不是为我工作。我确信使用了编辑的authenticationConfig.xml文件(如果我在它们中犯了错误,服务器拒绝加载它)。我究竟做错了什么?

+1

以下哪securitytests之一,你有没有适用于您的应用程序的Android环境 - 在应用程序descriptor.xml? –

+0

我的application-descriptor.xml中没有提到这些安全测试。所以,我认为默认测试(“mobileTests”和“customTests”)用于我的情况。原因,为什么我添加了其他安全测试,是我绝望的尝试禁用自动更新。 –

回答