ibm-mobilefirstworklight-adaptersworklight-serverworklight-security

How do I set an adapter's security test to come from worklight.properties?


My company is working on an application developed with MobileFirst v6.3. I'm looking at creating a server configuration that will allow the server to bypass our standard security test.

This is the type of entry I'm looking to make in my worklight.properties file:

#############
# Worklight Security Test
#############
mt.adapter.security=custom-security-test

And this is how I'm trying to place the value in the adapter's procedure:

<procedure name="getTechUserAdapter" securityTest="${mt.adapter.security}"/>

When I build and deploy it, I get this error:

<error mbeanName="com.worklight.common.server.jmx.api:qualifier=worklight,type=ProjectManagement" node="worklight///10.16.109.75" date="2016-06-02T19:58:02.889Z" phase="PREPARE" code="FAILURE" details="Procedure &apos;getTechUserAdapter&apos; in adapter &apos;TechUserServiceAdapter&apos; requires security test &apos;${mt.adapter.security}&apos; which is not defined in authenticationConfig.xml.">

Worklight is trying to translate it the security test as a string, and not the value that was placed in the worklight.properties file. Does anyone know how to make it use the variable value?


Solution

  • The security test definition does not support custom properties like what you're trying to do... it looks at the authenticationConfig.xml file.

    Instead you may need to keep multiple configurations and swap between them before you build the adapter.