Re-authorize a connection
Guide on how to re-authorize a connection.
There are cases where you need to re-authorize a connection, e.g. credentials have expired or the scopes/permissions have changed.
The simplest way is to delete and recreate the connection, but this will reset the connection’s attached data (metadata, synced records). Most of the time when testing, this is fine.
Follow the instructions below if you need to re-authorize a connection without altering it’s attached data.
Re-authorize a connection from your app
This is the recommended way to re-authorize production connections, so customers can re-authorize independently, without having to manually send you their account credentials.
You can implement the re-authorization flow in your app by having your backend call a different endpoint when the connection already exists.
Instead of generating the default endpoint to generate a session token, use the POST /connect/sessions/reconnect
endpoint (API/SDK reference) to generate a session token meant for reconnection. This token is then used on the frontend in the same way as when creating a connection, but it will reconnect the existing connection instead.
Re-authorize a connection from the Nango UI
This is only recommended for test connections, not production connections.
If you do intend to re-authorize a production connection from the Nango UI, be sure to use your customer’s account credentials.
The flow to re-authorize connections from the Nango UI is legacy. It will revamp shortly.
To re-connect from the UI, go to the Connections tab > click Add Test Connection > click Or use deprecated flow. Pick the relevant integration and enter the connection ID of the connection you want to re-authorize.
This flow leverage’s the headless client. Check out the reference to pass the right parameters based on the integration’s authorization type (OAuth, API key, basic auth).
Was this page helpful?