I tried to invoke a protected javascript resource adapter in MFP 8.0 cordova app (with mfp plugin also installed), without any specific security setted. Below the configuration used:
adapter.xml
<?xml version="1.0" encoding="UTF-8"?>
<mfp:adapter name="AccountAdapter"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:mfp="http://www.ibm.com/mfp/integration"
xmlns:http="http://www.ibm.com/mfp/integration/http">
<displayName>AccountAdapter</displayName>
<description>AccountAdapter</description>
<connectivity>
<connectionPolicy xsi:type="http:HTTPConnectionPolicyType">
<protocol>https</protocol>
<domain>mobilefirstplatform.ibmcloud.com</domain>
<port>443</port>
<connectionTimeoutInMilliseconds>30000</connectionTimeoutInMilliseconds>
<socketTimeoutInMilliseconds>30000</socketTimeoutInMilliseconds>
<maxConcurrentConnectionsPerNode>50</maxConcurrentConnectionsPerNode>
</connectionPolicy>
</connectivity>
<procedure name="getUser"/>
javascript app code
var resourceRequest = new WLResourceRequest("adapters/AccountAdapter/getUser", WLResourceRequest.GET);
resourceRequest.setQueryParameter("params", "[1]");
resourceRequest.send().then(success, loadFailure);
but the response was
worklight.js:10192 GET http://localhost:6015/mfp/api/adapters/AccountAdapter/getUser?params=%5B1%5D 401 (Unauthorized)
The test was made in Mobile Browser Simulator, for iOS platform.
I remember that, in previous versions of MFP, calls to adapters negotiate automatically the token to access to protected resource.
Is it still possible to do that, without sophisticate the authorization process?
If no, what is necessary to make call to a protected resource?