Handle ReAuth
In this guide, we’ll learn how you can handle Re-auth of a user for an integration
In Cobalt, re-authentication of a user for an integration is typically managed automatically.
In certain scenarios where automatic re-authentication is not feasible, users may need to manually handle re-authentication. This process becomes necessary when either the refresh tokens expire, OAuth apps are deleted, integrations are disconnected, or access tokens are manually expired by the user. To facilitate this, you can identify the need for re-authentication and guide your users through the reconnection process effectively.
Determining the Need for Re-Authentication
To determine if re-authentication is required, you can either use the List Applications API or .getApp() SDK method and check the reauth_required field in the response. By default, the field is false but if it returns true, then it indicates that re-authentication is necessary.
Manual Re-Authentication Process
If the reauth_required field is true
, then you need to get the user re-authenticated with the application.
React SDK: If you are using the Cobalt React SDK, Cobalt provides a pre-built Reconnect button for seamless reconnection.