OAuth 1.0 Configuration

An Integration Definition consists of three main components, which match the OAuth code-exchange flow. In order, they are:

  1. Access Token
  2. Request Token
  3. Authorization

To support the 3 legged OAuth1.0 flow two more top level components are available:

  • access_token element
    • url_template is the only available property. As always the url_template field may be templatized.
  • advanced_configuration
    • redirector is currently the only available advanced option. Specifying oauth1 will initiate and lock a flow into OAuth1.
Copy
Copied
import {
  AuthenticationType,
  AuthSpecification,
  OrderSourceAppMetadata,
} from "@shipengine/connect-order-source-api";
export const AuthProcess: AuthSpecification = {
  Identifier: {
    AuthenticationType: AuthenticationType.OAuth,
    IsSandbox: false,
  },
  access_token: {
    url_template: "http://www.example.com/v1/AccessToken",
  },
  request_token: {
    url_template: "http://www.example.com/v1/RequestToken",
  },
  authorization: {
    url_template: "http://www.example.com/v1/Authorise",
  },
  advanced_configuration: [
    {
      name: "redirector",
      value: "oauth1",
    },
  ],
};
export const Metadata: OrderSourceAppMetadata = {
  // DO NOT CHANGE THIS ID AFTER PUBLISHING
  Id: "bcce593b-dce3-4491-8722-a56e653c173f",
  Name: "Example",
  AuthProcess,
  OrderSources: [Example],
};

Advanced Topics

  • Response Transformation (specify how responses from the two exchanges can be mapped into the the platform canonical model)
  • Connection Context (allows a response transformer to specify a collection of properties in connection_context)
  • Templating (substituting values in your configuration)