Bot Uptime OAuth 2.1 Integration
Let users securely authorize third-party tools, desktop IDEs, and AI assistants (Claude, ChatGPT, Cursor, VS Code, Windsurf) to manage their Bot Uptime containers — without ever copying raw API keys.
Discover & Register
Read /.well-known/oauth-authorization-server and dynamically register a client via POST /oauth/register (RFC 7591).
Consent with PKCE S256
Redirect the user to /oauth/authorize with a SHA-256 code_challenge. The user approves exact scopes on a clean consent screen.
Exchange & Call API
Exchange the one-time authorization code + code_verifier at POST /oauth/token for a Bearer access token & refresh token.
1. OAuth & MCP Metadata Discovery
Bot Uptime implements both RFC 8414 (Authorization Server Metadata) and RFC 9728 (Protected Resource Metadata) so MCP clients auto-discover endpoints with zero manual configuration:
Returns issuer, authorization_endpoint, token_endpoint, registration_endpoint, supported scopes, and code_challenge_methods_supported: ["S256"].
Points MCP clients at https://botuptime.net/api/mcp and advertises https://botuptime.net as the trusted Authorization Server.
Register an OAuth client programmatically. Allowed redirect URI schemes: https://, http://localhost / 127.0.0.1, cursor://, vscode://, claude://, and windsurf://.
curl -X POST https://botuptime.net/oauth/register \
-H "Content-Type: application/json" \
-d '{
"client_name": "My Bot Automation Tool",
"redirect_uris": ["http://localhost:8765/callback"]
}'
Open this URL in the user’s browser. Plaintext PKCE is rejected — only code_challenge_method=S256 is accepted.
https://botuptime.net/oauth/authorize?response_type=code&client_id=YOUR_CLIENT_ID&redirect_uri=http%3A%2F%2Flocalhost%3A8765%2Fcallback&scope=read+write+power+deploy&state=RANDOM_CSRF_STATE&code_challenge=BASE64URL_SHA256_VERIFIER&code_challenge_method=S256
Exchange the single-use authorization code (valid 5 minutes) and original PKCE code_verifier for a Bearer token. Access tokens are valid for 30 days and can be refreshed seamlessly via grant_type=refresh_token.
curl -X POST https://botuptime.net/oauth/token \
-H "Content-Type: application/json" \
-d '{
"grant_type": "authorization_code",
"client_id": "YOUR_CLIENT_ID",
"code": "RETURNED_AUTH_CODE",
"redirect_uri": "http://localhost:8765/callback",
"code_verifier": "YOUR_ORIGINAL_RANDOM_VERIFIER"
}'
Supported Scopes & Instant Revocation
Available scopes: readwritepowerdeploy
Users can view every connected OAuth app, inspect its activity log, and revoke its access token immediately from Dashboard → AI Agents. All tokens are stored strictly as SHA-256 hashes — Bot Uptime never stores plaintext access or refresh tokens in SQLite.