Articles in this section

Create an OAuth 2.0 connection in Celigo via a third-party portal

Partners who run OAuth 2.0 flows on behalf of customers can limit security risks by building a custom app with a third-party service provider that allows their customers to authenticate OAuth 2.0 tokens without revealing their credentials to the partner.

Configure the customer-facing app for initial connection authorization

Use the following steps to build the customer-facing authentication interface:

  1. Create the connection and copy the connection ID.

  2. Configure your customer-facing app to send the following GET call to the connection’s OAuth 2.0 API endpoint:

    GET /v1/connection/:_connectionId/oauth2
  3. The GET call returns an authorizationURL for you to deliver to the customer via the customer-facing application.

  4. The customer enters their credentials and is then asked to allow Celigo to access their account and related data. The customer checks the confirmation box, and clicks Confirm.

  5. Celigo securely stores the customer’s authentication token in an encrypted iClient.

  6. Optionally, you can specify the URL of your choice upon successful OAuth 2.0 authentication. See Redirect to a custom authorization URL, below.

Configure the customer-facing app for token renewal

Redirect to a custom authorization URL

In most cases, partners would want to bypass the default integrator.io redirect that happens after completing OAuth 2.0 authentication, to send their customers to another URL.

  1. Retrieve the connection document mentioned above by making a GET request using the Celigo integrator.io API:

    GET /v1/connections/:_connectionId
  2. Copy the retrieved connection document ID.

  3. Make a PUT request to update the connection, passing the alternate URL of your choosing in the oauth2RedirectUrl field:

    PUT /v1/connection/:_connectionId
    
    {
      "http": {
        "auth": {
          "oauth": {
            "oauth2RedirectUrl": "https://partner.com/callback"
          }
        }
      }
    }
  4. After successfully updating the connection, make the following GET request to return the authorization URL:

    GET /v1/connections/:_connectionId/oauth2