scaledockhq/scaledock-skills/oauth
Claude Code and agent skill by scaledockhq/scaledock-skills
- community
Checking that the SKILL.md file is still in the repository.
OAuth 2.0 and 2.1: secure resource servers, clients and ASes. Covers OAuth 2.0 (RFC 6749, RFC 6750, current), the OAuth 2.1 draft (build preview), the RFC 9700, RFC 10017 (browser apps) and RFC 10027 (cross-device) BCPs, PKCE (RFC 7636), DPoP (RFC 9449), mTLS-bound tokens (RFC 8705), RAR (RFC 9396), token exchange (RFC 8693), resource indicators (RFC 8707), AS and resource metadata (RFC 8414, RFC 9728), iss (RFC 9207), step-up (RFC 9470), registration (RFC 7591/7592), Client ID Metadata Documents, introspection (RFC 7662), revocation (RFC 7009) and device grant (RFC 8628), plus drafts (rfc7523bis, client attestation, first-party apps, transaction tokens). Use when protecting an API with access tokens, validating tokens, writing WWW-Authenticate challenges, adding PKCE, DPoP or mTLS, publishing /.well-known metadata, building an authorization server, OAuth client or browser app, delegating with token exchange or authorization_details, reviewing an OAuth design against best practice, or upgrading 2.0 to 2.1.
Install
npx vskill@latest install scaledockhq/scaledock-skills/oauthSKILL.md
The same SKILL.md was published earlier as scaledockhq/scaledock-skills/oauth.
OAuth
OAuth 2.0 (RFC 6749) and its IETF extensions let a client obtain an access token from an authorization server (AS) and present it to a resource server (RS). OAuth 2.1, still an IETF draft, folds in the security fixes of RFC 9700. With this skill the agent builds or reviews a resource server, client or authorization server that follows those rules, with resource servers as the main focus.
Follow the workflow below step by step. Every rule here comes from a source in Sources, with the section it cites. When a rule and the pinned source disagree, the source wins; when the source has a newer revision than the pin, follow the refresh steps.
Inputs (fill in, or ask before starting)
- Role: resource server, client, authorization server, or a service that does more than one (for example an RS that exchanges tokens to call another RS).
- Token format and binding: JWT access tokens or opaque tokens with introspection; bearer, DPoP-bound or mTLS-bound.
- Target version: OAuth 2.0 (current, the default: RFC 6749 and RFC 6750 as updated by RFC 9700). OAuth 2.1 is a preview (posture: build,
draft-ietf-oauth-v2-1-16): apply its rules, because RFC 9700 already requires most of them, but cite it as a draft. OAuth 1.0 (RFC 5849) is legacy: read it only to replace it with OAuth 2.0, never author it. See `references/versions.md`. - Revision: the pinned revisions in Sources, unless the user names another. Drafts apply only at the posture recorded there.
- Sources: when refreshing this skill or when a rule looks out of date, re-read every URL in Sources first, check the IETF datatracker for a newer draft revision or a published RFC, and update the pins.
Invariants
- The resource server validates every token fully (OAuth 2.1 draft -16 § 5.2). Not expired, issued for this resource, with the scope or authorization details the operation needs. A token meant for another resource MUST be refused (RFC 9700 § 2.3).
- Tokens never travel in the URL query. Clients MUST NOT send them there and resource servers MUST ignore them (OAuth 2.1 draft -16 § 5.1; RFC 6750 § 2.3).
- Failures answer with `WWW-Authenticate` (RFC 6750 § 3).
invalid_tokenwith 401,insufficient_scopewith 403, no error code when no credentials were sent (RFC 6750 § 3.1), andinsufficient_user_authenticationfor step-up (RFC 9470 § 3). - Bound tokens need their proof on every request. A DPoP-bound token is accepted only when all RFC 9449 § 4.3 checks pass and its key matches
cnf.jkt(§ 7.1); it MUST be rejected when sent asBearer(§ 7.2). An mTLS-bound token MUST match the TLS client certificate (RFC 8705 § 3). - The authorization code grant uses PKCE with S256. Public clients MUST use it; the AS MUST enforce it and MUST prevent PKCE downgrade (RFC 9700 § 2.1.1; RFC 7636 § 4.2).
- Redirect URIs match exactly, except the localhost port for native apps (RFC 9700 § 2.1).
- No implicit grant and no password grant. The implicit grant SHOULD NOT be used (RFC 9700 § 2.1.2); the password grant MUST NOT be used (RFC 9700 § 2.4).
- Clients check where responses came from. With more than one AS, a mix-up defense is REQUIRED (RFC 9700 § 2.1): compare
issto the expected issuer (RFC 9207 § 2.4). Metadata whoseissuerorresourcedoes not match is not used (RFC 8414 § 3.3; RFC 9728 § 3.3). - Refresh tokens for public clients are sender-constrained or rotated (RFC 9700 § 2.2.2).
- Introspection is authenticated and never cached past `exp` (RFC 7662 § 2.1, § 4).
- Delegated tokens are authorized on the subject and the current actor only (RFC 8693 § 4.1).
- Unknown authorization details are refused with
invalid_authorization_details(RFC 9396 § 5).
Workflow
- Pick the version, then fix the role and the token model. Target OAuth 2.0 with the OAuth 2.1 rules applied. Write down who issues tokens, who validates them, the token format, and whether tokens are bound.
-> references/versions.md ✓ The target is OAuth 2.0 with RFC 9700 and the OAuth 2.1 draft named by revision, every party in the design has a role, and the RS knows whether it reads JWTs or calls introspection.
- Validate tokens at the resource server. Read the token from the header, validate it as a JWT or through introspection, then check audience, scope and authorization details for the exact operation.
-> references/resource-server.md ✓ A token for another audience, an expired token and a token without the needed scope are each refused.
- Write the challenges. Return the right status, error code and
resource_metadatafor each failure.
-> references/resource-server.md ✓ Each failure in the table in the reference produces its listed status and WWW-Authenticate value.
- Publish protected resource metadata at
/.well-known/oauth-protected-resourcewithresourceequal to the resource identifier (RFC 9728 § 2, § 3).
✓ A client can go from a 401 to the AS metadata without configuration.
- Add sender constraint with DPoP or mTLS where clients support it.
-> references/sender-constraint.md ✓ A replayed DPoP proof, a wrong ath and a bound token sent as Bearer are each refused.
- Build the client side, if in scope: discovery, authorization code with PKCE,
isscheck, resource indicators, challenge handling, device grant, and the browser-app architecture (RFC 10017).
-> references/clients.md ✓ Every authorization request has a fresh S256 challenge, every response's iss is checked, and a browser app uses a BFF unless the reference allows otherwise.
- Build the authorization server side, if in scope: PKCE enforcement, codes, metadata, introspection, revocation, registration, and cross-device mitigations (RFC 10027).
-> references/authorization-server.md ✓ The AS metadata lists every supported feature, and the AS refuses codes reused, PKCE downgrades and unknown redirect URIs.
- Handle delegation and fine-grained access, if in scope: token exchange,
act,resource,authorization_details.
-> references/delegation.md ✓ Downstream tokens are audience-restricted and narrower than the incoming token.
- Apply drafts only at their posture.
-> references/drafts.md ✓ Each draft feature in use names its pinned revision.
- Upgrade (only when asked). Move an OAuth 2.0 deployment to the OAuth 2.1 rules with the checklist, or replace an OAuth 1.0 integration with OAuth 2.0.
-> references/versions.md ✓ The AS refuses requests without PKCE, plain challenges, response_type=token and the password grant, and existing clients keep the same scopes and audiences.
Verify before done
- [ ] The RS refuses expired tokens, wrong-audience tokens, tokens in the query string and
none-signed JWTs. - [ ] Each failure returns the status and
WWW-Authenticateerror from RFC 6750 § 3.1, RFC 9470 § 3 or RFC 9449 § 7.1, withresource_metadata. - [ ]
/.well-known/oauth-protected-resourcereturnsresourceequal to the resource identifier. - [ ] DPoP: all twelve RFC 9449 § 4.3 checks run,
jtireplay is limited, and a DPoP-bound token sent asBeareris rejected. - [ ] Clients send S256 PKCE, check
iss, and sendresource. - [ ] The AS enforces PKCE, matches redirect URIs exactly, returns
iss, and publishes RFC 8414 metadata. - [ ] Introspection callers authenticate, and cached results expire no later than the token.
- [ ] Client assertions carry the AS issuer identifier as their sole
aud. - [ ] Browser apps follow RFC 10017, and any cross-device flow has a risk assessment and the mitigations of RFC 10027.
- [ ] Every draft in use carries its pinned revision and posture.
Reference index
- `references/versions.md`: OAuth 2.0, the OAuth 2.1 preview and legacy OAuth 1.0, what each changed with the RFC 9700 section behind it, the 2.0 to 2.1 checklist and replacing 1.0. Load for steps 1 and 10.
- `references/resource-server.md`: reading and validating tokens, introspection, authorization details,
act, challenges, RFC 9728 metadata, and a TypeScript example withjose. - `references/sender-constraint.md`: DPoP proofs, the RFC 9449 § 4.3 checks, nonces and replay, and mTLS certificate-bound tokens.
- `references/clients.md`: discovery, authorization code with PKCE,
iss, resource indicators, challenge handling, the device grant, browser-based applications (RFC 10017) and registration. - `references/authorization-server.md`: authorization and token endpoints, codes, RAR, metadata, introspection, revocation, device grant, cross-device flows (RFC 10027), browser-based clients and dynamic registration.
- `references/delegation.md`: token exchange, delegation versus impersonation, resource indicators and Rich Authorization Requests.
- `references/drafts.md`: OAuth 2.1, Client ID Metadata Documents, identity chaining, rfc7523bis, attestation-based client authentication, first-party apps, transaction tokens, RAR remediation, the Security BCP update, refresh token expiration, SPIFFE client authentication and deferred token responses, each with its posture.
Related skills
jwtfor JWT access token formats and the JOSE verification checklist:npx skills add ScaleDockHQ/scaledock-skills --skill jwtopenid-connectfor ID tokens and sign-in on top of OAuth:npx skills add ScaleDockHQ/scaledock-skills --skill openid-connectgnapfor the Grant Negotiation and Authorization Protocol:npx skills add ScaleDockHQ/scaledock-skills --skill gnapmcp-authorizationfor the OAuth profile used by Model Context Protocol servers:npx skills add ScaleDockHQ/scaledock-skills --skill mcp-authorizationcibafor Client-Initiated Backchannel Authentication, the cross-device alternative RFC 10027 prefers over the device grant:npx skills add ScaleDockHQ/scaledock-skills --skill cibawimsefor workload-to-workload authentication alongside transaction tokens and SPIFFE client authentication:npx skills add ScaleDockHQ/scaledock-skills --skill wimsespiffefor the SVIDs and trust bundles behind SPIFFE client authentication:npx skills add ScaleDockHQ/scaledock-skills --skill spiffesd-jwtfor Selective Disclosure JWTs, the OAuth working group's selective disclosure format:npx skills add ScaleDockHQ/scaledock-skills --skill sd-jwt
Sources
Status uses the publishing body's own maturity term. Checked is the date the source was last read.
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/oauth/SKILL.md
Popularity
- 7-day trend score
- 5
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/scaledockhq/scaledock-skills/oauth)