Dynamic Authentication

Prev Next

In some cases, dynamic authentication is needed based on a certain set of criteria (e.g. domains).

  • Use authData to feed this information into the Adapter Utils so that a request can be dynamically authenticated based on the criteria that was set.

  • When the authData param is added to adapter.js, it is added to the Authentication request object.

Example: Dynamic authentication data.

const reqObj =
  payload: { garbage: 'need since post' },
  uriPathVars: [groupId, deviceId],
  uriQuery: { name: 'anyname' },
  uriOptions: { page: 2 },
  addlHeaders: { audit: 'turnOn' },
  authData: { domain: 'abc' },
  callProperties: {
    stub: true,
    request: {
      attempt_timeout = 60000
    }
  },
  filter: '[*name=doggie]',
  priority: 1,
  event: 'giveMeMyData'
};