Custom Callback URL
You can change the callback URL of Nango if you want to personalize it (e.g. use your own domain). If you are using Nango Cloud, follow these steps:- Add a new endpoint in your app, e.g.
https://EXAMPLE.com/oauth-callback
. All requests to this endpoint should redirect tohttps://api.nango.dev/oauth/callback
and pass along all original parameters. The easiest way to do this is with a 308 redirect. - Change the registered OAuth callback URL with all API providers. Otherwise, they will refuse new flows!
- When you are ready, change your Nango callback URL in the Project Settings page (cloud).
Before saving the custom callback URL in Nango, ensure that:
- the callback URL redirects to
https://api.nango.dev/oauth/callback
(e.g. 308 redirect) and passes along all query parameters - your OAuth app, as registered with the external API provider, has the new callback URL whitelisted
Connection Configuration
Some APIs require additional parameters to run an OAuth flow or make API requests. Some examples:- Zendesk OAuth has the following authorization URL, where the subdomain is specific to a user’s Zendesk account:
- Qualtrics, Shopify, and Gorgias have the same per-customer subdomains as Zendesk
- Salesforce uses a different API base URL per customer, e.g.
https://mycustomer.api.salesforce.com
- Zoho uses different API base URLs for different data centers. E.g. US customer’s data is at
https://accounts.zoho.com
and EU customer’s athttps://accounts.zoho.eu
Setting Connection Configuration
For some APIs, Nango requires additional details from the end user to run an OAuth flow or make API requests. This is documented in two places:- On the API’s Nango docs page
- On the dashboard page for Adding a new Connection (Recommended)
nango.auth()
:
Automatically retrieved Connection Configuration
Some Connection Configurations, such as the base URL for the Salesforce API, are automatically retrieved by Nango. This is noted on the API’s Nango docs page. Nango will automatically use this information for the Proxy, but if needed, you can also retrieve it (see next section).Fetching Connection Configuration data
Nango stores all configuration data in the connection objects. You can retrieve it with the SDKs or REST API.Storing custom metadata per Connection
Nango lets you store arbitrary metadata on the Connection. This is useful for:- Storing custom field mappings per customer (e.g. map “name” from the external API to “firstname” in your data model)
- Storing per-customer configuration (e.g. which filters for syncing objects, categories to skip etc.)
- Any other per-connection data you want to have available in your sync scripts
getMetadata()
:
Connection-Specific Authorization Params
Some APIs require to pass additional query parameters in the authorization URL. If this applies to all users & use-cases, these params can be added to the providers.yaml API configurations. But sometimes, the additional authorization parameter is specific to a user or a use-case. In this case, it is possible to add it to thenango.auth()
call from the Frontend SDK:
Securing the Frontend SDK calls with HMAC
By default, this feature is disabled and your frontend can attempt to create a new connection using any Integration ID and Connection ID. But you might want to ensure that the app user is the only one that can create a new connection with that Connection ID. To enable this feature:- Add a secret HMAC key in your Project Settings. Pick a large, random value!
- Generate the HMAC signature in your backend and pass it to your frontend where you make the
nango.auth
calls. - When ready, enable the HMAC check in the Project settings. Nango will now reject auth calls without or mismatching HMAC signature, so make sure your code is ready before you flip the switch!
nango.auth
: