Use this file to discover all available pages before exploring further.
This guide will help you understand how to set up a standard refresh token flow for an OAuth app. For more details on which flow to use or how to set up your OAuth app within Kit, please refer to the more general “Authentication” guide.We also offer example OAuth implementations that can be viewed below:
Unique, human-readable identifier for a tenant of a multi-tenant app.
Example Kit app configuration
Found on the “Authentication” tab in your app settings:
3
Kit prompts user for consent
Kit will present a consent screen that asks the user to grant or refuse your app access to their account.
Example Kit app OAuth page
4
Kit redirects to App OAuth callback with authorization code
If the user grants access, Kit redirects the user back to the redirect_uri you provided when requesting the user’s identity in step 2.
Kit appends a code query param with a temporary authorization code.
Kit also appends a state query param with the same value sent in the authorization request. This check helps verify that the user, not a malicious script, is making the request and reduces the risk of CSRF attacks.
Now that the user has completed the OAuth flow, your app must send the the user back to Kit using the redirect parameter provided at the beginning of the flow.
This will ensure the user properly navigates back to your app inside of Kit and registers that the app has been installed.
If you have set up the Redirect URL after install field in your app’s settings, a modal prompting creators to continue their journey on your configured site will appear at this point. See this section in the app details page guide for more details.
Example redirect flow
7
App uses access token to make Kit API calls
Your app can now make calls to Kit’s API on behalf of the user by passing a Authorization header with the token as a Bearer value.
App uses refresh token to obtain new access token after expiration
The access token will eventually expire and a new one must be obtained using the refresh token obtained earlier. To do this, make a POST call to https://api.kit.com/v4/oauth/token, with the following body: