Connector OAuth

OAuth callback handler

Changed on

Finish the OAuth sign-in: exchange the provider's <code>code</code> for tokens and store them. Call it with the <code>code</code> and <code>state</code> the provider sent to the redirect URI, as the connector's creator or an admin.<br><br> <b>Result:</b><br> Always JSON. <code>success</code> is true when the connector is signed in; otherwise <code>error</code> and <code>errorMessage</code> say why. Provider tokens are never returned.

get/connectors/oauth/callback

Request

  • Base URL
    https://app.pipeshub.com/api/v1
  • URL
    https://app.pipeshub.com/api/v1/connectors/oauth/callback
  • Auth
    • HTTP bearer
    • or OAuth 2
      Authorization code: /api/v1/oauth2/authorize
      Client credentials
      Token URL: /api/v1/oauth2/token scopes: connector:write

Query parameters

codestring required

Authorization code from provider. A missing, empty or blank value is refused with 400, even when the provider only sent error.

statestring required

State parameter (contains connector ID). A missing, empty or blank value is refused with 400.

errorstring

Error code if authorization failed

baseUrlstring

Origin prefixed to the returned redirectUrl

Response

Result of exchanging the code. success is false when the provider refused it.

successboolean required

Whether tokens were stored and the connector is authenticated

redirectUrlstring

Where the web app would send the user next

errorstring

Only when success is false. The provider's own code when it was passed in error, otherwise one of invalid_state, instance_not_found, config_not_found, oauth_config_fetch_error, invalid_token or server_error.

errorMessagestring

Only when error is server_error. A readable reason for the failed token exchange.

Example response

{
  "redirectUrl": "https://pipeshub.mycompany.com/connectors/oauth/callback?oauth_error=access_denied",
  "error": "access_denied"
}

Changes

    • breaking

      added the pattern \S to the query request parameter code

    • breaking

      added the pattern \S to the query request parameter state

    • info

      added the non-success response with the status

    • info

      endpoint added