OAuth (Open Authorization) is an open standard protocol that allows third-party applications to access resources on behalf of users without exposing their credentials. Klavis AI implements OAuth 2.0 to securely connect with services like GitHub, Slack, Gmail, Notion, and more.
White labeling allows you to customize the authentication experience with your own branding. When enabled, users will see your application name, logo, and other brand elements during the OAuth flow instead of Klavis AI’s.
Make sure to add the callback url to your app’s OAuth allow list.
3
Implement OAuth Authorization
Redirect users to the Klavis AI OAuth authorization endpoint with your client ID:
Copy
Ask AI
// Example: Initiating GitHub OAuth with white labelingconst authUrl = `https://api.klavis.ai/oauth/github/authorize?instance_id=${instanceId}&client_id=${yourClientId}`;window.location.href = authUrl;
You can also specify scope and redirect_url in the authUrl, check the api reference for more details.
4
(Optional) Add Your Own Callback URL
For simplicity, you can use the default callback URL: https://api.klavis.ai/oauth/{server_name}/callback,
as shown in the previous step. This is the endpoint where we handle user credentials for authentication.However, some OAuth consent screens (such as GitHub’s) display the callback URL to the user. If this URL doesn’t match your application’s domain, it can appear untrustworthy.To address this, you can use a callback URL under your own domain and set up a redirect—either via DNS or within your application—that forwards requests to:
https://api.klavis.ai/oauth/{server_name}/callback. Below is an example using FastAPI to simply redirect from your Github oauth application to Klavis oauth service in python -