Authorize an API from you app (custom UI)
Step-by-step guide on getting user authorization with your own UI.
Pre-requisites:
- complete the Configure an integration guide
- generate a Connect session token
Integrate the frontend SDK
In your frontend, initiate Nango (reference):
Initiate the authorization flow (reference):
For OAuth, the nango.auth()
method will trigger the OAuth flow in a popup, to let the user log in to their external account.
Handle APIs requiring connection-specific configuration for authorization
Some APIs require connection-specific configuration (e.g. Zendesk, Shopify).
For example, Zendesk has the following authorization URL, where the subdomain is specific to a user’s Zendesk account:
https://<USER-SUBDOMAIN>.zendesk.com/oauth/authorizations/new
When using the Connect UI, this information is collected from the end user with an automatically-generated form.
But when using a custom UI, you must provide this configuration when calling nango.auth()
(reference):
In some cases you might want to override the scopes provided by an integration at the connection level. For this case you can pass in the scopes to nango.auth
:
This connection configuration is stored in the connection. You can retrieve it with the SDK (reference) and API (reference), or see it in connection details in the Nango UI.
Next
Once the authorization succeeds, follow the Save the connection ID section to finish implementation of the authorization flow.
Questions, problems, feedback? Please reach out in the Slack community.
Was this page helpful?