Browse docs
How does SkedCast OAuth work?#
SkedCast OAuth is the authorization code flow with PKCE (RFC 7636): your app holds no password or client secret, and the user approves your scopes on a consent screen.
For your own scripts use an API key instead: no redirect, no refresh (authentication). Make a first request with the 5-minute quickstart.
- Public clients only: PKCE with S256 is mandatory and there is no client secret to store.
- A redirect URI that is
https, or anhttploopback URL (127.0.0.1,localhostor[::1]) for a native or command-line client. Anything else is rejected at registration. - Scopes chosen: a token's power is its scopes intersected with the user's role (scopes).
- One token family per user and workspace; never share a token between users.
- API keys and the REST API are included from Studio, and MCP access for AI clients from Solo. See the pricing page for the current plans.
Endpoints#
| Method | Path | Purpose |
|---|---|---|
| GET | /.well-known/oauth-authorization-server | AS metadata (RFC 8414) |
| GET | /.well-known/oauth-protected-resource/v1 | REST API resource metadata (RFC 9728): resource, authorization_servers, scopes_supported, bearer_methods_supported |
| GET | /.well-known/oauth-protected-resource/mcp | MCP resource metadata (RFC 9728), also served at /.well-known/oauth-protected-resource |
| GET | /.well-known/jwks.json | Public keys for token verification |
| POST | /oauth/register | Dynamic client registration (RFC 7591) |
| GET/PUT/DELETE | /oauth/register/:id | Manage a registration (RFC 7592) |
| GET | /oauth/authorize | Authorization endpoint (PKCE) |
| POST | /oauth/token | Exchange code / refresh for an access token |
| POST | /oauth/revoke | Revoke a refresh token and its rotation family (RFC 7009), always 200 |
Server capabilities#
- Grants:
authorization_codewith PKCE (S256only) andrefresh_token. No client-credentials, device, JWT-bearer or token-exchange grant, and no introspection endpoint. - Public clients only:
token_endpoint_auth_methods_supportedisnone. - Authorization responses carry the
issparameter (RFC 9207). - A
client_idcan be the HTTPS URL of a Client ID Metadata Document instead of a registered id. - A request without a token answers
401withWWW-Authenticate: Bearer resource_metadata="…"; a token without the needed scope answers403 insufficient_scope.
OAuth 2.1 versus 2.0#
OAuth 2.1 consolidates OAuth 2.0 and the security advice written since. It is still an Internet-Draft: draft-ietf-oauth-v2-1-17 is an Active Internet-Draft that expires on 4 May 2027 (IETF, read 22 November 2026).
RFC 9700 says refresh tokens for public clients must be sender-constrained or rotate (IETF RFC 9700, read 22 November 2026). The client is often an app or hosted AI agent that cannot keep a secret.
| OAuth 2.1 change | What the draft says | What SkedCast does |
|---|---|---|
| PKCE on the code grant | The authorization code grant requires the PKCE parameters | Required on every authorization request, and only S256 is accepted |
| PKCE plain method | Removed | Refused: there is no plain option |
| Implicit grant | Left out | Not offered: the grants are authorization_code and refresh_token |
| Password grant | Left out | Not offered |
| Redirect URIs | Compared by exact string matching | Matched exactly; registration accepts an https URL or a loopback http URL only |
| Public clients | Refresh tokens one-time-use or sender-constrained | Public clients only. Refresh tokens rotate on every use, and reusing a spent one revokes the whole chain |
| Bearer token in the URL | Not used in the query string | Send the token in the Authorization header |
Credential lifetimes#
| Credential | Lifetime | Rule |
|---|---|---|
| Authorization code | 10 minutes | Works once; a second exchange fails with invalid_grant |
| Access token | 15 minutes | Bearer; audience-bound |
| Refresh token | 30 days | Rotates on every use |
| PKCE verifier | One authorization | 43 to 128 characters |
| Default scope | Read-only | When scope is omitted |
Connect an app, step by step#
Eight steps, from discovery to a revoked session.
1. Discover the authorization server#
A 401 from the REST API points at the resource metadata, which names the authorization server and its own metadata (RFC 8414, RFC 9728). A client that follows them never types an OAuth URL.
# 1. Call the API with no token and read the challenge
curl -i https://api.skedcast.com/v1/agency
# 2. Read the REST API resource metadata named in WWW-Authenticate
curl https://api.skedcast.com/.well-known/oauth-protected-resource/v1
# 3. Read the authorization server metadata it points to
curl https://api.skedcast.com/.well-known/oauth-authorization-serverHTTP/1.1 401 Unauthorized
WWW-Authenticate: Bearer error="invalid_token", error_description="The access token is invalid or expired", resource_metadata="https://api.skedcast.com/.well-known/oauth-protected-resource/v1"2. Register your client (DCR)#
Register once (RFC 7591) to get a client_id. Keep the registration_access_token to update or delete the registration (RFC 7592). Or use the HTTPS URL of a Client ID Metadata Document as the client_id, with nothing to register.
redirect_uriishttps, orhttpon loopback for a native or command-line client; anything else is refused withinvalid_redirect_uri.- A loopback redirect matches on any port (RFC 8252 §7.3), so register it without one.
- Redirect URIs are matched exactly at sign-in.
curl -X POST https://api.skedcast.com/oauth/register \
-H "Content-Type: application/json" \
-d '{
"client_name": "My App",
"redirect_uris": ["https://myapp.com/oauth/callback"],
"scope": "posts.read posts.compose"
}'{
"client_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"client_id_issued_at": 1751299200,
"client_name": "My App",
"redirect_uris": ["https://myapp.com/oauth/callback"],
"grant_types": ["authorization_code", "refresh_token"],
"response_types": ["code"],
"token_endpoint_auth_method": "none",
"scope": "posts.read posts.compose",
"registration_access_token": "reg_…",
"registration_client_uri": "https://api.skedcast.com/oauth/register/f47ac10b-…"
}3. Generate a PKCE pair#
Per authorization, create a code_verifier of 43 to 128 characters and its S256 code_challenge (RFC 7636). Keep the verifier private; put the challenge in the authorize URL. plain is refused.
import { randomBytes, createHash } from "node:crypto";
// code_verifier: 43-128 unreserved chars (RFC 7636 §4.1)
const codeVerifier = randomBytes(32).toString("base64url");
// code_challenge = base64url(SHA-256(verifier)) (RFC 7636 §4.2)
const codeChallenge = createHash("sha256")
.update(codeVerifier)
.digest("base64url");4. Send the user to authorize#
Redirect the browser to /oauth/authorize. The user signs in and consents, and SkedCast redirects back to your redirect_uri with ?code=…&state=…&iss=…; an error comes back the same way.
- Verify
statematches what you sent, andissequals the issuer in the metadata (RFC 9207). - Ask for the fewest scopes the feature needs; the user sees them in plain words. With none named, the token gets the default read-only scopes.
- Send
resourceto pick the audience (RFC 8707). It is fixed at this step; repeat it at the token step, where a mismatch isinvalid_target.
Resource values#
| You want to call | Send resource= | Accepted by |
|---|---|---|
| The REST API | https://api.skedcast.com/v1 | Routes under /v1 only |
| The MCP server | https://api.skedcast.com/mcp | The MCP server only (the default when resource is omitted) |
GET https://api.skedcast.com/oauth/authorize
?response_type=code
&client_id=f47ac10b-…
&redirect_uri=https://myapp.com/oauth/callback
&scope=posts.read%20posts.compose
&state=<random-csrf-token>
&code_challenge=<codeChallenge>
&code_challenge_method=S256
&resource=https://api.skedcast.com/v15. Exchange the code for tokens#
POST the code with your code_verifier and the same resource. SkedCast verifies the PKCE challenge and returns an access and a refresh token. The code is valid for 10 minutes and works once.
curl -X POST https://api.skedcast.com/oauth/token \
-H "Content-Type: application/x-www-form-urlencoded" \
-d grant_type=authorization_code \
-d code=<authorization_code> \
-d redirect_uri=https://myapp.com/oauth/callback \
-d client_id=f47ac10b-… \
-d code_verifier=<codeVerifier> \
-d resource=https://api.skedcast.com/v1{
"access_token": "eyJ…",
"token_type": "Bearer",
"expires_in": 900,
"scope": "posts.read posts.compose",
"refresh_token": "eyJ…"
}6. Call the API with the token#
Send the access token as a Bearer credential, exactly like an API key. Its power is scopes ∩ the user's role (scopes), and it must have been issued for the REST API (conventions).
curl https://api.skedcast.com/v1/agency \
-H "Authorization: Bearer eyJ…"7. Refresh an expired access token#
Refresh before the 15 minutes end, or when a call returns 401. The new pair keeps the original resource and is re-checked against the person's current access, so scopes may narrow after a demotion.
curl -X POST https://api.skedcast.com/oauth/token \
-H "Content-Type: application/x-www-form-urlencoded" \
-d grant_type=refresh_token \
-d refresh_token=eyJ… \
-d client_id=f47ac10b-…8. Revoke access on logout#
Revoke the refresh token (RFC 7009) when the user disconnects: it ends the whole rotation family. The endpoint always returns 200, even for an unknown token. Access tokens are not revoked one by one; they expire within 15 minutes.
curl -X POST https://api.skedcast.com/oauth/revoke \
-H "Content-Type: application/x-www-form-urlencoded" \
-d token=eyJ…Errors#
The /oauth/* endpoints return { "error": "invalid_grant", "error_description": "…" } as application/json with a 4xx status, not the /v1 problem+json. Branch on error.
| Code | Meaning |
|---|---|
invalid_request | The request is malformed |
invalid_client | An unknown or blocked client_id |
invalid_grant | A code or refresh token that is spent, expired or issued for another redirect URI |
invalid_target | A resource that does not match the one sent at the authorize step |
unsupported_grant_type | A grant SkedCast does not implement |
invalid_scope, unsupported_response_type | Both are returned through the authorize redirect |
invalid_client_metadata | A registration whose grant_types leave no authorization_code, or whose response_types leave no code; other unsupported values are dropped, not refused |
Troubleshoot#
| Symptom | Cause | Fix |
|---|---|---|
invalid_grant at the token step | A code already used, expired after ten minutes or issued for another redirect URI | Start a new authorization. Log the error and description, never the code or tokens |
| Many refreshes fail at once | Two workers refreshed the same token, or an older copy overwrote the stored refresh token | One refresher per grant; store the newest refresh token |
| Authorize request refused | plain PKCE, or a redirect URI that differs by a slash or port | Send code_challenge_method=S256 and the exact registered string |
Token 401s on /v1 | The token was issued for the MCP server, the default when resource is omitted | Request resource for the REST API |
| Redirect comes back with an error, not a code | The user denied consent | Treat it as a normal outcome; keep the user signed in to your app and offer the connection later |
| Refresh fails after a while | The grant was revoked, or the user left the workspace; SkedCast re-reads access on every request, so Disconnect in Settings → Connected apps takes effect at once | Start the authorize step again; the user authorizes again if they join a different workspace |
Verify the integration#
- Call
GET /v1/agencywith the token:200means it is valid and allowed to read the workspace. - Test refresh before you ship: after 15 minutes, confirm the app refreshes, stores the new refresh token and retries once.
- Reuse an old refresh token on purpose in a test workspace to see the family revoked.
- In development, register a loopback redirect such as
http://127.0.0.1, authorize in your browser and print the token response, using a test workspace.
Security checklist#
- Send a random
stateand check it on return, so a forged callback is rejected. - Check that
issequals the issuer in the metadata; it defends against mix-up attacks (RFC 9207). - Keep the
code_verifieron your server and use a new pair for every authorization. - Store tokens on your server, encrypted at rest, never in browser storage or logs. The access token can live in memory.
- Store the newest refresh token after every refresh, with the user it belongs to, and never reuse an old one.
- Update a registration with its
registration_access_token(RFC 7592) instead of registering a new client for every change. - Record the client id, user or workspace, scopes, time and outcome of each authorize, token and refresh call. Never log codes, tokens or the PKCE verifier.
- Revoke the refresh token when the user disconnects.
Related reference#
Pages for what an OAuth token can do.
- API reference: every
/v1endpoint. - Media uploads and webhooks.
- API error catalogue: every
/v1code. - SkedCast SDK: wraps the REST calls, not authorize or refresh.
- Partner onboarding.
- MCP and AI agents and the MCP server.
- API and webhooks: which plans include them.
- Developer changelog: dated changes to the flow.
- SkedCast developer docs: every other page.
Sources#
All read 21 November 2026, except RFC 9700 and RFC 9728 (read 22 November 2026). Token lifetimes, the code lifetime and the default scope are how the SkedCast API issues tokens. Next review: 21 February 2027.
- RFC 7636, Proof Key for Code Exchange
- RFC 8414, authorization server metadata
- RFC 7591, dynamic client registration
- RFC 7009, token revocation
- RFC 9207, the iss parameter
- RFC 8707, resource indicators
- RFC 7592, registration management
- RFC 8252, OAuth for native apps
- RFC 9728, protected resource metadata
- RFC 9700, OAuth 2.0 security best current practice
- IETF OAuth 2.1 draft (draft 17, updated 30 October 2026)