Skip to content

docs: clarify PKCE vs client authentication and refresh tokens#448

Open
dhensby wants to merge 1 commit into
node-oauth:masterfrom
dhensby:docs/pkce-client-auth
Open

docs: clarify PKCE vs client authentication and refresh tokens#448
dhensby wants to merge 1 commit into
node-oauth:masterfrom
dhensby:docs/pkce-client-auth

Conversation

@dhensby

@dhensby dhensby commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

What

Documentation-only clarifications from the PKCE / refresh standards review (#288), making the behaviour explicit so the same confusion doesn't recur.

Changes

  • docs/guide/pkce.md — new "PKCE, client authentication and refresh tokens" section: code_verifier applies only to the authorization_code exchange (not refresh); PKCE is not a substitute for client_secret; and how to let public clients refresh without a secret (with the caveat that it relaxes the presence check for the whole grant).
  • Model#getClient JSDocclientSecret is absent for public clients and for PKCE authorization_code requests even when the client has a secret, so the model must reject a confidential client that omits it.
  • requireClientAuthentication JSDoc (server.js + index.d.ts) — setting a grant to false disables the client_secret presence check for the whole grant (all clients), so per-client (public vs confidential) enforcement belongs in getClient.
  • Regenerated docs/api/model.md and docs/api/server.md.

Context

Follows the standards review on #288 (closed as works-per-spec). The deeper per-client public/confidential distinction remains tracked in #81; this PR just documents the current, correct behaviour and the model's responsibilities. Docs only — no code/behaviour change; npm run lint passes.

🤖 Generated with Claude Code

@dhensby dhensby mentioned this pull request Jun 16, 2026
Documents the conclusions from the PKCE/refresh standards review so the
recurring confusion doesn't return:

- guide/pkce.md: new section explaining that code_verifier applies only to
  the authorization_code exchange (never refresh), that PKCE is not a
  substitute for client_secret, and how to allow public clients to refresh
  without a secret.
- Model#getClient JSDoc: clientSecret is absent for public clients and for
  PKCE authorization_code requests even when the client has a secret, so the
  model must reject a confidential client that omits it.
- requireClientAuthentication (server.js JSDoc + index.d.ts): disabling a
  grant turns off the client_secret presence check for the whole grant (all
  clients), so per-client enforcement belongs in getClient.

Regenerated docs/api/model.md and docs/api/server.md.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant