Skip to main content

What is OAuth 2.0?

OAuth 2.0 is a type of connection that lets your customers authorize your integration to act on their behalf without giving you their username or password. For example, customers can authorize your integration to fetch their Salesforce leads, create Slack channels, or generate QuickBooks invoices for them. Prismatic's OAuth 2.0 service generates authorization URLs, handles token exchange and token refresh, and ensures that up-to-date keys are available to your instances when they run.

Get startedOAuth 2.0 crash course

Watch a video that sets up OAuth 2.0 apps from scratch and adds OAuth 2.0 authentication to integrations.

GuideAuthorization code grant type

Register a third-party OAuth app, then configure and disconnect authorization code connections.

GuideTroubleshooting OAuth 2.0 connections

Diagnose client ID, redirect URI, token exchange, and token refresh errors.

How OAuth 2.0 works for your customers​

You've probably used OAuth 2.0 when you clicked "Log in with my Google Account" or "Connect my Dropbox" on a website. You don't enter your Google or Dropbox credentials into the website. Instead, you enter your credentials on a Google or Dropbox page, and the OAuth provider generates a unique code that grants the website a set of your permissions.

With Prismatic, you can offer your customers a single "Connect to Acme" button in your integrations' config wizard, and your customers can grant you permission to their accounts in other platforms.

Configure OAuth 2.0 connection via Prismatic app

Why use OAuth 2.0?​

OAuth 2.0 has some advantages over other authentication mechanisms (like basic auth):

  1. Authentication is simple for users. They click a "connect" button and select "I approve" on a permissions consent screen, and the OAuth service takes care of the rest.
  2. Permissions are granular. Your customers can grant you permission to do specific tasks in their account, like "read Salesforce leads" or "write Slack messages".
  3. Customers don't hand you their credentials. They authenticate with the third-party app, and your app receives an access token with permission to do specific tasks. If they change their third-party password, they don't need to update their integration configuration.
  4. Customers can generally revoke tokens at any time. Most apps have a screen that lists the apps with access to an account, such as Acme has read access to your Dropbox files, with a "revoke access" button.

OAuth 2.0 grant types​

The OAuth 2.0 framework supports several grant types, three of which are common for B2B integrations:

  1. Most common is the Authorization Code grant type. When one of your customers configures an integration, they click a "Connect to Dropbox" or "Connect my Salesforce" button. After logging in to the external app and consenting to give you permissions to their account, the user returns to a Prismatic callback URL, and the authorization code they brought back is exchanged for an access token that you can use to access their data.
  2. The Client Credentials grant type is also common in integrations. Sometimes called the machine to machine (M2M) grant type, this process is a little more involved for your customer. They log in to their third-party app, generate a Client ID / Client Secret key pair, and enter their key into your integration's config wizard. That key pair is exchanged for an access token for the third-party app.
  3. While officially deprecated, the Password grant type prompts a user for their username and password for a third-party app. That username and password are exchanged for an access token.