Search code examples
ibm-mobilefirstworklight-adaptersworklight-security

Is it possible to protect single procedure with multiple security test in Adapters IBM Worklight


I am creating app and I have added Android, Mobile webapp as an Worklight Environment that means I want to use same App as webapp(by using its URL). I am creating 2 seperate security test one is Mobile security test and other one is Web security test, but my Adapters procedure are common(for eg:procedure1), **So is it possible to apply two security test to one single procedure.**This is what I tried but it didn't worked.

Following is my Mobile security Test

    <mobileSecurityTest name="BankingTest">
        <testDeviceId provisioningType="none" />
        <testUser realm="BankingRealm" />
        <testDirectUpdate mode="perSession" />
    </mobileSecurityTest>

Following is my Web security Test

    <webSecurityTest name="BankingWebTest">
        <testUser realm="BankingWebRealm"/>
    </webSecurityTest>

Following is how procedure is protected in xml file

<procedure name="getDetail" securityTest="BankingTest"/>(Its working).

But when I tried

    <procedure name="getDetail" securityTest="BankingTest"/>
   <procedure name="getDetail" securityTest="BankingWebTest"/>
                   --OR--
<procedure name="getDetail" securityTest="BankingWebTest;BankingTest"/>

its not working.

My requirement is: I want to protect 1 same procedure with 2 different security test. So Please suggest me what is better approach and how.


Solution

  • I don't think that you need a separate realm for web and mobile.

    Additionally, you cannot set more than one securityTest per procedure.

    Consider not using two realms if not required and then use a custom securityTest instead of one for web and one for mobile.