https://your-sourcebot-instance.com with the URL of your Sourcebot deployment.
Register an OAuth application
Register your app with dynamic client registration. Registration does not need authentication. Do it once and store the returnedclient_id.
client_name and logo_uri are shown to users on the consent screen.
Sourcebot does not issue client secrets. Every client is a public client and proves its identity with PKCE. Wildcard redirect URIs are not allowed.
Redirect the user to Sourcebot
Send the user’s browser to the authorization endpoint. If they are not signed in, Sourcebot asks them to sign in first. They then approve or deny your app on the consent screen.
Do not send a
scope parameter. Sourcebot does not define any scopes yet, and a request with a scope fails with invalid_scope.
Example
Handle the redirect
When the user approves, Sourcebot redirects to yourredirect_uri with a code and the state you sent. Always check that state matches the value you sent before you continue.
Exchange the code for tokens
Exchange the code and the PKCEcode_verifier for an access token and a refresh token.
Example
Response
Make API requests
Send the access token as a Bearer token in theAuthorization header, the same way you would send an API key. Access tokens work with the public API and the MCP server. The scoped access token endpoints are the exception and require an API key.
Refresh an access token
When the access token expires, exchange the refresh token for a new access token.
The response has the same shape as the code exchange, including a new
refresh_token.
Revoke a token
Revoke a token when the user disconnects your app. Revoking an access token does not revoke its refresh token, so revoke both. Revoking the current pair does not revoke access tokens issued before the most recent refresh. Those tokens remain valid until they expire.
The endpoint always returns
200, even if the token does not exist.
Users can also see and disconnect authorized apps in Settings → MCP → Connected clients.
Token lifetimes
Administrators can change these with environment variables.
Discovery
Sourcebot publishes authorization server metadata (RFC 8414) at/.well-known/oauth-authorization-server. Clients that support discovery can read the endpoint URLs from it instead of hard-coding them.
