Depending on how you interact with PaceCast—via the web studio, programmatic API route handlers, or an autonomous AI agent environment—the platform supports three authenticated channels:
- Session Cookies: HTTP-only authenticated cookies for web browser sessions.
- Bearer JWTs: Signed, short-lived tokens minted through RFC 8414 / RFC 9728 OAuth 2.1 PKCE authorization for MCP agents.
- API Keys: Header-based authentication (
x-api-key) for internal services and specialized automated integrations.
Authentication Overview
| Mechanism | Type | Usage, Headers & Expiry |
|---|---|---|
Bearer JWT (MCP)required | HTTP Header | Standard Authorization header: 'Bearer <token>'. Issued via PKCE authorization code grant. Default TTL is 3600 seconds (1 hour). |
Web Sessionrequired | HTTP-only Cookie | Secure, SameSite cookie managed by Supabase Auth for browser studio sessions. |
API Secret Keyoptional | HTTP Header | Transmitted via 'x-api-key: <key>' for automated backend workers and report generation. |
OAuth 2.1 & PKCE Authorization (MCP)
PaceCast implements standard RFC 8414 and RFC 9728 OAuth discovery for AI agent ecosystems such as ChatGPT and Claude desktop. The authorization server enforces Proof Key for Code Exchange (PKCE) with S256 challenges.
Step 1: Authorization Code Request
The agent directs the user to our authorization endpoint with a SHA-256 code challenge:
GET /api/oauth/authorize?
response_type=code
&client_id=pacecast-mcp
&redirect_uri=https%3A%2F%2Fchatgpt.com%2Faip%2Fcallback
&code_challenge=E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM
&code_challenge_method=S256
&state=xyz123 HTTP/1.1
Host: pacecast.appStep 2: Code Exchange for Access Token
The client exchanges the single-use authorization code along with the original code_verifier:
curl -X POST "https://pacecast.app/api/oauth/token" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=authorization_code" \
-d "code=auth_code_789abc" \
-d "code_verifier=dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk" \
-d "client_id=pacecast-mcp"Bearer JWT Validation
Calls to the Model Context Protocol endpoint (/api/mcp) require an authorized Bearer token:
curl -X POST "https://pacecast.app/api/mcp" \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "list_clients",
"arguments": {}
}
}'Tenant Isolation & Row-Level Security
PaceCast enforces tenant isolation at the database layer. Regardless of whether a request arrives from an interactive browser session, an external AI agent, or an API call:
- Every JWT or session identifies an authenticated user UUID in the
subclaim. - Every workspace query explicitly verifies that
owner_id = user.idoruser_id = user.id. - Cross-tenant lookups return
404 Not Foundrather than403 Forbidden, preventing workspace ID enumeration.