我正在使用IBM MobileFirst Platform Foundation 7开发混合应用程序。
我面临自定义直接更新的问题,我有两个选择:立即更新或更新。当我选择更新应用程序时,一切正常。但是当我选择“以后”时,我无法登录(适配器服务无法与MobileFirst服务器通信)。
wl_directUpdateChallengeHandler.handleDirectUpdate = function(directUpdateData, directUpdateContext) {
// custom WL.SimpleDialog for Direct Update
var customDialogTitle = 'Update Available';
var customDialogMessage = 'Update your application to get new features';
var customButtonText1 = 'Update Application';
var customButtonText2 = 'Not Now';
WL.SimpleDialog.show(customDialogTitle, customDialogMessage,
[{
text : customButtonText1,
handler : function() {
directUpdateContext.start();
}
},
{
text : customButtonText2,
handler : function() {
wl_directUpdateChallengeHandler.submitFailure();
}
}]
);
};
authenticationConfig.xml
<customSecurityTest name="SubscribeServlet">
<test realm="SubscribeServlet" isInternalUserID="true"/>
</customSecurityTest>
<customSecurityTest name="AuthSecurityTest">
<test isInternalUserID="true" realm="AuthRealm"/>
</customSecurityTest>
<customSecurityTest name="xssSecurity">
<test realm="wl_antiXSRFRealm" isInternalUserID="true" step="1"/>
</customSecurityTest>
<realm loginModule="AuthLoginModule" name="AuthRealm"> <className>com.worklight.integration.auth.AdapterAuthenticator</className>
<parameter name="login-function" value="LoginAdapter.onAuthRequired"/>
<parameter name="logout-function" value="LoginAdapter.onLogout"/>
</realm>
<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>
<loginModule name="AuthLoginModule">
<className>com.worklight.core.auth.ext.NonValidatingLoginModule</className>
</loginModule>
<loginModule name="StrongDummy" expirationInSeconds="3600">
<className>com.worklight.core.auth.ext.NonValidatingLoginModule</className>
</loginModule>
<loginModule name="requireLogin" expirationInSeconds="3600">
<className>com.worklight.core.auth.ext.SingleIdentityLoginModule</className>
</loginModule>
<loginModule name="rejectAll" expirationInSeconds="3600">
<className>com.worklight.core.auth.ext.RejectingLoginModule</className>
</loginModule>
应用程序描述符
<iphone bundleId="" version="1.0">
<worklightSettings include="false"/>
<security>
<encryptWebResources enabled="false"/>
<testWebResourcesChecksum enabled="false" ignoreFileExtensions="png, jpg, jpeg, gif, mp4, mp3"/>
</security>
</iphone>
<userIdentityRealms/>
<accessTokenExpiration>3600</accessTokenExpiration>
<android version="1.0">
<worklightSettings include="false"/>
<security>
<encryptWebResources enabled="false"/>
<testWebResourcesChecksum enabled="false" ignoreFileExtensions="png, jpg, jpeg, gif, mp4, mp3"/>
<publicSigningKey/>
<packageName/>
</security>
</android>
<ipad bundleId="" version="1.0">
<worklightSettings include="false"/>
<security>
<encryptWebResources enabled="false"/>
<testWebResourcesChecksum enabled="false" ignoreFileExtensions="png, jpg, jpeg, gif, mp4, mp3"/>
</security>
</ipad>
<windowsPhone8 version="1.0">
<uuid>dfae1768-838f-4fda-acc8-11b201cae4d0</uuid>
</windowsPhone8>
<mobileWebApp cacheManifest="no-use" securityTest="xssSecurity" xFrameOptions="SAMEORIGIN"/>
<windows8 version="1.0">
<description>windows8 is the identifier Windows 8 Universal desktop/tablet Universal app. Use the Package family name from the package.appxmanifest file as the value for the packageName tag</description>
<uuid>edff315b-76ed-4bdb-b710-f44462081793</uuid>
</windows8>
<windowsphoneuniversal version="1.0">
<description>windowsphoneuniversal is the identifier for Windows Phone Universal. Use the Package family name from the package.appxmanifest file as the value for the packageName tag</description>
<uuid>46bbad67-8f1a-4c5a-8d1a-5400ef36a787</uuid>
</windowsphoneuniversal>