Step-by-step guide on how to getting user authorization to access an external API on their behalf.
Callback URL
. Use the one displayed in the Nango integration settings. Remember to register the required scopes in the Nango integration settings and, if necessary, with the API provider.
Collect your OAuth app’s Client ID
and Client Secret
from the API portal and input them in your Nango integration settings.
For API Key & Basic
No configuration is necessary for APIs supporting API key & Basic authorization.
For Custom Authorization
APIs like Stripe & GitHub Apps have custom authorization. Configurations vary and are described in the Nango integration settings.
Connect
to test the authorization. After authorizing API access for one of the modes described below, a connection should be successfully created in the Connections tab.
For OAuth
Input your external account credentials in the popup dialog to test the authorization.
For API Key & Basic
Input the API key (or username/password for Basic) to test the authorization.
For Custom Authorization
The authorization flow will vary based on the API, but you will most likely have to log in to your external account via a popup dialog.
Public Key
from the Environment Settings tab.
In your frontend, initiate Nango (reference):
nango.auth()
method will trigger the OAuth flow in a popup, to let the user log in to their external account.nango.auth
calls. The HMAC digest can be generated with the following code (node example):
nango.auth
(reference):
https://<USER-SUBDOMAIN>.zendesk.com/oauth/authorizations/new
For these cases, you must provide this configuration when calling nango.auth()
(reference):
https://EXAMPLE.com/oauth-callback
. All requests to this endpoint should redirect to https://api.nango.dev/oauth/callback
and pass along all original parameters. The easiest way to do this is with a 308 redirect.