OAuth2: Authorization code grant

Overview
Copy

This is the default and preferred way of authenticating services that use OAuth2 based authentication as it ensures high security.

For this, you'll need to create an OAuth app with the third party service.

You will then need:

  1. client ID and client secret of the OAuth app

  2. authentication URL and access token URL of your third party service

Please follow the steps below:

Authentication Demo
Copy

Spotify
Copy

To demonstrate how to set up an OAuth2 service with Auth code grant flow, this demo will use the Spotify API Docs for the remainder of this example.

Note for Parameterization
Copy

Parameterization allows you to provide the values for fields like Client Id, Client Secret and the API url at the time of creating authentications. It adds:

  1. reusability as you can use different OAuth apps in different integrations by creating a single service

  2. security as you don't have to expose the values in the services page and you will only feed them while creating the auth.

Here's an example on how it can make your service reusable:

Shopify has custom URL for domains, you can parameterize the url in the OAuth 2 settings by passing a placeholder as: {{shopify_url}}

Now you can add the same placeholder value below in the 'Authentication parameters' section

NOTE: The unique property key has to match the placeholder value you passed in the settings.