Dynamic user per request
Scenario
This system authenticates based on the identity of the person making the request rather than a shared system account. User credentials must be passed into the adapter method on each call and used to override the credentials in the service instance configuration for that call only.
The adapter library handles this via callProperties in the reqObj — no changes to the library are needed. However, code changes in adapter.js and pronghorn.json are required.
Even when credentials are passed dynamically, you should still provide values in the service instance configuration. The adapter may not start up if these fields are empty.
Configuration
adapter.js
Accept a credentials object in the method signature (containing dynuser and dynpass). Set the values in callProperties.authentication on the reqObj. The adapter library will use these credentials instead of the ones defined in the service instance configuration for this call only.
Using a single object parameter rather than two separate parameters makes it easier to add fields in the future.
pronghorn.json
Add the credentials input parameter to each affected method in pronghorn.json so it can be passed in from anItential Platform workflow.