Worklight Authenticity

怎甘沉沦 提交于 2019-12-02 00:05:35

The problem has been fixed.

Solution:

1- we changed the MobileSecurityTest in authenticationConfig.xml to be customSecurityTest as the following, AND redeployed the WAR file:

<customSecurityTest name="MobileSecurityTest">
        <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>

2- In application-descriptor.xml:

For android, I used what Idan said about adding the <packageName> property.

<android securityTest="MobileSecurityTest" version="1.0">
    <worklightSettings include="false"/>
    <security>
        <encryptWebResources enabled="true"/>
        <testWebResourcesChecksum enabled="true" ignoreFileExtensions="png, jpg, jpeg, gif, mp4, mp3"/>
        <publicSigningKey>"Our public signing Key placed here"</publicSigningKey>
        <packageName>ca.company.MobileTest</packageName>
    </security>
</android>

For iOS, the issue was in the applicationId, we thought the applicationId value is the last section of the bundleId,

for example: if the bundleId is "com.company.Myapp" that's mean the applicaiotnId is "Myapp", which is not true.

This is incorrect definition:

<iphone bundleId="ca.company.MobileTestiPhone" applicationId="MobileTestiPhone" securityTest="MobileSecurityTest" version="1.0" >

The applicationId is the value inside the worklight.plist file, which is located inside the iPhone or iPad native folder and this file is generated after doing the build. AND for our appliction it has a totally different value.

The correct one was:

<iphone bundleId="ca.company.MobileTestiPhone" applicationId="MobileTest" securityTest="MobileSecurityTest" version="1.0" >

That's why the app was being blocked from our WL server when we put the App authenticity value to "Enable,Blocking".

Thank you @Idan for your help.

Per the error message, you are missing the Android Package Name (in application-descriptor.xml).

This is the Authenticity tutorial for Hybrid apps for v6.3, but it's the same for 6.2. From the Android instructions:

Take the Application package name value from the package attribute of the manifest node in the AndroidManifest.xml. If you decide to change the value to another, verify that you change it in both locations.You can also directly edit application-descriptor.xml and add a packageName:

<android version="1.0">
        <worklightSettings include="false"/>
        <security>
            <encryptWebResources enabled="false"/>
            <testWebResourcesChecksum enabled="false" ignoreFileExtensions="png, jpg, jpeg, gif, mp4, mp3"/>
            <publicSigningKey>MIGff ...</publicSigningKey>
            <packageName>com.MyBankApp</packageName>
        </security>
</android>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!