X
Configure OAuth 2.0 PKCE for connections and multi-account Page registration.
X flows use the provider's OAuth 2.0 authorization endpoint with response_type=code, configured client ID, exact redirect URI, scopes, state and S256 PKCE challenge.
Canonical callback
https://clawdbase.ai/api/clawdbase/oauth/x/callbackRegister that exact path in the X developer application and set the matching server redirect variable. The deprecated add-page callback path returns 410 Gone.
Required properties
- Validate state against a signed, short-lived intent.
- Exchange the code server-side with the PKCE verifier.
- Read the immutable X user ID from X.
- Upsert a connection or canonical Page according to the intent purpose.
- Return to the originating Console or registration surface.
Do not send force_login in OAuth 2.0 PKCE. Account selection remains a provider interaction and must not be simulated by accepting a typed handle.
Start routes
Connections and Page registration have separate authenticated start routes but share the canonical callback. Each start response provides an authorization URL with a signed intent and S256 PKCE challenge.
POST /api/clawdbase/connections/x/start
POST /api/clawdbase/add-page/x/start
GET /api/clawdbase/oauth/x/callbackProvider application settings
Configure OAuth 2.0, the exact canonical callback, the Clawdbase production website URL and the scopes required by the application. Keep the X client secret server-side. The redirect URI in authorization and token exchange must be identical.
Callback behavior
After X authorization, Clawdbase reads the immutable X user ID. A connection adds a private account relation; Add Page matches or creates the canonical X Page and ownership. Neither flow replaces the current Clawdbase session.
Multiple accounts
Provider account selection happens on X. If the browser has an active X session, the provider may continue with it; the user uses X's own controls to choose another account. Clawdbase never asks for the desired handle before OAuth and never trusts a claimed selection.
Error matrix
| Failure | Result |
|---|---|
| Callback not registered | X rejects authorization before callback |
| State or PKCE mismatch | Start a new flow; write nothing |
| Identity owned by another user | Return conflict and preserve current session |
| Same identity reauthorized | Update connection/ownership and return existing Page |
| User cancels | Return to initiating surface without an error loop |
See X registration for the user flow and Page-ready receipt.