/developer-platform-skills:oauth2-provider-designfrom developer-platform-skills
Designs the OAuth2 authorization-server surface for a B2B SaaS platform offering third-party apps.
Ships in developer-platform-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
You are an OAuth provider designer. Design the authorization-server surface a platform offers third-party apps: protocol profile, token lifecycle, scope taxonomy, consent screen, registration, verification. Do it so a compromised app or leaked token is a contained event, and so the platform never faces the forced retrofit Salesforce's ISV ecosystem lived through in 2026.
This is decision guidance for a platform/API team, not an RFC tutorial. The target profile is OAuth 2.1, with one precision to carry everywhere:
The requirements are settled convergence regardless of the document's own publication status. Never state that OAuth 2.1 itself is a published RFC without first confirming that's still accurate.
Memory (advised): When memory lives in a file, consider using developer-platform-context.md; if a different memory system is in use, rely on that instead. The file is an advisory reference, not a mandatory requirement. Separate task info in different sections. Remove finished tasks. Add a date to a task; no date for general project context. Some interview responses may differ between 2 tasks.
Ask before designing anything; each answer changes a later step. Batch them - this is tactical design, not a strategy interview.
If your harness has persistent memory, store the core decisions: grant list, TTLs and rotation posture, scope naming convention and token-type binding, verification tiers and thresholds. A later run (a scope addition, a review-program escalation, a token-theft incident) then starts from the design instead of re-deriving it.
The B2B/B2C split that matters here is who stands between the app and the grant:
The protocol core, token lifecycle, and plain-language consent-copy rules are identical for both - only the approval topology and the app-identity/org-wide scope tier differ. A B2B provider must design the admin surface (approval queue, org-wide grant review, app-identity permission tier) as a first-class part of steps 2-3, not bolt it on when the first enterprise customer asks.
Build in this order - each stage is load-bearing for the next, and the order is the staged sequence the cross-provider research converged on:
Implement authorization_code with PKCE (S256, mandatory for every client - public and confidential alike), client_credentials, refresh_token, and device_authorization (RFC 8628, for CLIs and headless clients). Do not implement implicit or the password grant - both are removed under OAuth 2.1; a greenfield server has no reason to ever support them.
localhost redirects. RFC 9700's own justification: pattern matching "turned out to be more complex to implement and more error-prone", with "several successful attacks exploiting flaws in the pattern-matching implementation... observed in the wild" (RFC 9700).Refresh-token posture - three candidates, ranked:
security value: sender-constrained (DPoP) > rotation + reuse detection > non-rotating with a per-client cap
third-party client-library compatibility: non-rotating > rotation > DPoP
effort: DPoP > rotation > non-rotating
efficiency: rotation + reuse detection > non-rotating > DPoP
Default rung: rotation with token-family reuse detection. Every refresh token belongs to a family traceable to the original grant; a consumed token presented again revokes the whole family (the Auth0/Keycloak/Django OAuth Toolkit convergent pattern). Ship a reuse grace window from day one - around 10-30 seconds - or multi-tab SPAs and network retries will read as attacks and log real users out. RFC 9700 §4.14 states what the tripwire buys: the server "cannot determine which party submitted the invalid refresh token, but it will revoke the active refresh token" - it's a tripwire, not an investigation tool.
DPoP is the starved option: strongest posture, and near-zero ecosystem support - 0 of 18 mainstream issuers with a working discovery document advertised DPoP support (MojoAuth issuer survey). Promote it when tokens guard financial or health data (FAPI 2.0 accepts DPoP or mTLS as its baseline) or when long-lived AI-agent tokens widen the theft blast radius; Bluesky's mandatory-DPoP deployment proves it production-viable at scale. Otherwise it's a support burden few client libraries can even meet yet - Stage 4, not here.
Non-rotating survives only in two bounded forms:
An indefinitely-reusable refresh token for a public client is not a rung to demote - it's banned under 2.1; delete it from the menu.
Cap refresh-token lifetime hardest for browser clients: Microsoft's SPA-specific 24-hour refresh-token lifetime, versus 90-day inactivity elsewhere (Microsoft Learn), is the reusable threshold - a refresh token in browser storage is a structurally higher-exposure asset.
This ranking is a default, not a law - re-rank against question 6: a provider building on an identity product that ships DPoP as configuration (Keycloak 26.4 does; vendor docs) flips DPoP's effort line, and a retrofit with thousands of live integrations flips rotation's.
Endpoints, storage mechanics (hashed tokens vs the grace window's cleartext need), and the compliance-gate pattern: references/protocol-baseline.md.
Two granularity rungs, ranked - the broad catch-all scope is deleted below, not ranked:
blast-radius containment: fine-grained per-resource permissions > resource:action scopes
integrating developer's effort: fine-grained > resource:action (more decisions per install)
provider effort: fine-grained > resource:action (a permission taxonomy is weeks of mapping and enforcement work, then a long migration)
efficiency: resource:action > fine-grained
Default rung: resource:action naming with a read/write split and read-only defaults - the dominant idiom across Slack, Microsoft Graph, and Stripe Connect (provider docs; comparison table in references/scope-taxonomy-archetypes.md). Name scopes after the same resource nouns the API itself uses - samber/developer-platform-skills@public-api-design-review owns that naming consistency.
Fine-grained per-resource permissions are the starved option (GitHub Apps: 50+ independent permissions, per-repository restriction, 1-hour installation tokens; GitHub docs) - promoted when org admins demand approval policies, a compliance regime is in scope, or scopes reach org-wide data. Budget for the documented cost: GitHub's own fine-grained model still "cannot accomplish every task" the classic broad model can (GitHub docs). Granular models lag broad ones in edge-case coverage through the whole transition, so keep the coarse tier alive during migration rather than forcing a lossy cutover.
Deleted anti-pattern, not a bottom rung: the single broad catch-all scope. GitHub's classic repo grants read and write to everything with no way to request less. GitHub's own fine-grained-PAT launch post frames coarse scopes plus immortal tokens as a leading contributor to real breaches (GitHub blog, 2022). Designing one in 2026 is choosing the failure mode the entire field is migrating off.
Taxonomy rules that are cheap now and ruinous to retrofit:
chat:write posts as the app on a bot token and as the human on a user token, and its own migration guidance warns that changing that binding later "requires reauthorization from every user" (Slack docs). Microsoft expresses the identical split as delegated-vs-application permissions with admin-only consent on the application side.Consent screen:
Full archetypes and consent mechanics: references/scope-taxonomy-archetypes.md, references/consent-screen-design.md.
Client registration - two rungs, ranked by control retained per unit of onboarding friction; open dynamic registration is deleted below, not ranked:
control over who integrates: manual/reviewed registration > gated dynamic registration
integration friction for developers: manual > gated dynamic
efficiency: manual/reviewed > gated dynamic
Default: manual developer-portal registration with a review step. The negative finding is the argument: no major B2B SaaS platform offers ungated public dynamic client registration - GitHub, Slack, Stripe, and Salesforce all require portal registration plus review. When every legitimate client goes through onboarding anyway, DCR's core value (registering a client with no prior relationship) doesn't apply.
Promote to gated DCR (RFC 7591 behind an initial access token, rate-limited, all metadata treated as untrusted input) only when deliberately serving an MCP/AI-agent ecosystem where clients discover servers dynamically - the one population that can't pre-register.
Open, ungated DCR is deleted, not demoted: a May 2026 preprint probing 119 OAuth-enabled remote MCP servers found DCR flaws in 96.6% of them, and the MCP spec itself walked DCR from SHOULD to MAY to deprecated across 2025-2026 (MCP spec revisions). Self-asserted registration metadata can impersonate any legitimate app's name and logo unless cryptographically attested - an open endpoint is a phishing kit.
Verification tiers - rank review depth by trust bought per unit of developer friction, and scale it to data sensitivity, never one bar for all apps:
trust signal bought: third-party security assessment > self-attestation > publisher identity verification
developer friction: third-party assessment > self-attestation > identity verification
efficiency: identity verification > self-attestation > third-party assessment
Default rung: publisher identity verification for every listed app - Microsoft's model: domain plus verified partner account, no fee, "verified in minutes" for a prepared publisher (Microsoft Learn). It proves continuity of identity, not quality - and pair it with Microsoft's real enforcement lever: unverified publishers can't receive consent for permissions beyond basic profile in risk-managed tenants.
Self-attestation is the middle rung - cheap (Microsoft: "most attestations can be completed in one hour or less") and explicitly not independently verified (Microsoft Learn). Keep the three signals visually distinct on your listing surface: Microsoft's own docs say the identity badge "doesn't imply or indicate quality criteria" - one undifferentiated checkmark for identity, attestation, and audit misleads every buyer reading it.
Mandatory third-party security assessment is the starved rung: months of calendar time, plus a direct assessor fee the developer pays rather than you. That fee runs roughly an order of magnitude higher for the full-pentest tier than for the scan tier (community-reported CASA pricing; figures in the reference). One bright-line condition every studied program draws promotes it: the moment a scope grants access to other users' data or PII, not just the requesting user's own (cross-provider review-program comparison), with annual recurrence on CASA's 12-month cadence.
Give unverified apps a legitimate testing lane, modeled on Google's: bounded named test users, a visible warning screen, and hard ceilings - Google's is a 100-user lifetime cap that verification alone lifts (current Google docs; older sources say 50) plus 7-day test-token expiry. "Verify before you scale" only works when the ceiling is real.
Enforce at runtime, not just at review: reject any scope request that isn't a subset of what was declared and approved at registration - Google's unverified-app warning fires exactly on that divergence, because declarations drift.
The cautionary tale to cite when this stage gets deprioritized: the August 2025 Salesloft Drift OAuth-token campaign hit 700+ organizations (Google Threat Intelligence/Mandiant). Salesforce's response, four mandatory OAuth controls including PKCE and rotation on all connected apps enforced May 11, 2026 with de-listing as the penalty (Salesforce ISV communications), is what a forced retrofit looks like. Full program comparison: references/app-verification-program.md.
Each is a named, documented trap - not a hypothetical:
Gates - iterate until every one passes:
Trends to baseline from launch (no industry thresholds exist): median app-review turnaround, share of apps requesting scopes their traffic never uses, reuse-detection trip rate (a proxy for both attacks and a too-tight grace window).
full_access scope."See also, same collection:
samber/developer-platform-skills@api-auth-key-management - the key-or-OAuth boundary decision and everything on the key side of it; this skill starts once that decision lands on OAuth for third-party apps.samber/developer-platform-skills@mcp-server-offering - the MCP resource-server posture that consumes the authorization server designed here.samber/developer-platform-skills@api-versioning-policy - deprecating a scope or sunsetting a grant type follows the same notice-window and sunset-signalling discipline as any breaking API change.samber/developer-platform-skills@zapier-integration-playbook - Zapier as an OAuth client: it refreshes tokens only on HTTP 401, and changing the auth scheme later forces a new integration major version.samber/developer-platform-skills@google-workspace-marketplace-playbook - the client side of a live verification program: Google's scope tiers, demo-video review and CASA assessment, as a vendor goes through them.samber/developer-platform-skills@app-marketplace-review - the ongoing security/quality review process for listed apps; step 3 here designs the verification gate; that skill owns the standing review operation behind the marketplace.samber/developer-platform-skills@api-ephemeral-token-issuance - minting short-lived, down-scoped tokens per sandbox or agent run, with no consent screen and no refresh token.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
62 skills in this plugin
/agent-integration-surfacesPlans how a SaaS or developer platform opens itself to AI agents, provider side - which agent classes may reach which surface, how an agent proves its identity and acts for a user (Web Bot Auth, delegated tokens, provision-then-claim signup), which execution path each gets, where agents find it (Context7, api-catalog) and how agent usage is counted. Use whenever someone asks if their product is agent-ready, why agents get blocked or cannot sign up, or how agents should authenticate to it. Do NOT use for MCP tool design (samber/developer-platform-skills@mcp-server-offering), surface build order (samber/developer-platform-skills@api-integration-surface-strategy) or agent-readable docs (samber/developer-relations-skills@coding-agent-docs-optimization)./agent-skill-offeringShips an Agent Skill (SKILL.md) inside the GitHub repo of the library, CLI or SDK it documents, versioned with the code - repo placement, metadata.version bumped every release, CI that fails a release on a stale skill, tag-pinned installs (skills.sh, gh skill, ClawHub, plugin marketplaces), plugin manifests, OpenClaw gating, skill vs MCP vs CLI. Use whenever a tool maintainer mentions shipping a skill with their tool, a SKILL.md for their library, keeping a skill in sync with releases, or plugin.json versions for a skill beside code - even if they never say "agent skill". Not for standalone skill collections. Do NOT use for CLI command or --json design - use samber/developer-platform-skills@cli-interface-design; nor for MCP servers - use samber/developer-platform-skills@mcp-server-offering./api-auth-key-managementDesign the API-key authentication surface a platform issues to its own API consumers - key format with prefix+checksum conventions, hashed (irretrievable) vs encrypted (retrievable) storage, zero-downtime rotation with dual-key overlap, least-privilege scoping, individual vs org vs service-account ownership, self-service key dashboard behavior, and SOC 2 / PCI-DSS 4.0 lifecycle governance. Use whenever the user mentions API keys, secret keys, key prefixes, key rotation, key scoping, or revoking keys after an employee departure - even if they never say "API key management". Provider side only, not consuming another vendor's API. Do NOT use for OAuth authorization-server design - use samber/developer-platform-skills@oauth2-provider-design instead./api-beta-programRuns an early-access, preview, beta or design-partner program for a new API feature: program shape, what each pre-GA label guarantees (SLA, support, breaking-change notice, pricing, data terms), stage on the wire, partner selection, per-account access, feedback cadence, exit to GA or kill, and rescuing betas that never ended. Use whenever the user mentions an API beta or preview program, design partners, beta labels or allowlists, production traffic on their own beta endpoint, or when to go GA - even if they only say "let a few customers try the new endpoint before it's final". Not for whole-app beta testing, a vendor's beta you consume, or canary rollouts of a GA change. Do NOT use for the stable version lifecycle - use samber/developer-platform-skills@api-versioning-policy./api-changelog-automationDesigns the provider-side pipeline that turns contract diffs of an API you publish (OpenAPI, GraphQL SDL, protobuf, AsyncAPI) into a breaking-change CI gate and a traced, per-version API changelog feed, classified by your own policy. Use whenever the user mentions oasdiff, openapi-diff, graphql-inspector diff, buf breaking, API schema checks, failing a PR on breaking changes to a published API contract, or an auto-generated API changelog. Do NOT use for release-note prose (samber/developer-relations-skills@changelog-writing), consumer-side upgrades (samber/developer-relations-skills@version-migration-guide), deprecation policy (samber/developer-platform-skills@api-versioning-policy) or callers of deprecated endpoints (samber/developer-platform-skills@integration-health-monitoring)./api-ephemeral-token-issuanceDesign the platform side of minting short-lived, narrowly scoped API tokens from the API itself - one per sandbox or AI-agent run, from hundreds to 1M+ mints per second - and expiring or revoking them on time at that scale. Covers the mint endpoint, permission x resource-scope attenuation, token format, lazy expiry, and per-run kill switches. Use whenever the user mentions ephemeral or per-run tokens, per-sandbox credentials, a token-minting API, or expiring millions of tokens - even without saying "token issuance". Provider side only, never consuming another vendor's tokens. Do NOT use for long-lived keys - use samber/developer-platform-skills@api-auth-key-management; nor user sessions, consent or refresh tokens - use samber/developer-platform-skills@oauth2-provider-design.npx claudepluginhub samber/developer-platform-skills --plugin developer-platform-skillsOther plugins' skills for the same job