Authentication to a Different Host

Prev Next

Scenario

This system has a two-step authentication, but the request to retrieve a token is to a different host than the actual system we are integrating with. Think of this as a separate single sign-on system that returns a token that can be used with any other system.

Changes to the action.json File:

  • Notice the SSO object. This object allows you to define a protocol, host, and port to retrieve the token from. It overrides any information from the adapter properties or the callProperties.
  • The protocol and port can be omitted if they are the same as the adapter or call properties.

action.json Example

{
  "name": "getToken",
  "protocol": "REST",
  "method": "POST",
  "entitypath": "{base_path/{version}/authenication/login",
  "requestSchema": "tokenReqSchema.json",
  "responseSchema": "tokenRespSchema.json",
  "timeout": 0,
  "sendEmpty": false,
  "requestDatatype": "JSON",
  "responseDatatype": "PLAIN",
  "headers": {}, 
  "sso": {
    "protocol": "https",
    "host": "tokenhost",
    "port": 443
  },
  "responseObjects": [
    {
      "type": "default",
      "key": "",
      "mockFile": "mockdatafiles/getToken-default.json"
    }
  ]
},