Skip to content

Extend token exchange diagnostics#121

Open
casey-brooks wants to merge 1 commit intomainfrom
noa/issue-120
Open

Extend token exchange diagnostics#121
casey-brooks wants to merge 1 commit intomainfrom
noa/issue-120

Conversation

@casey-brooks
Copy link
Copy Markdown
Contributor

Summary

  • add token endpoint url/path, content type, and body key order to token exchange diagnostics
  • share body-key derivation across proxy callback/token flows
  • expand proxy-flow diagnostics assertions

Testing

  • pnpm lint
  • pnpm typecheck
  • pnpm test
  • pnpm test:e2e
  • pnpm exec dotenv -e .env.test -o -- pnpm build

Related: #120

@casey-brooks casey-brooks requested a review from a team as a code owner March 19, 2026 13:43
@vercel
Copy link
Copy Markdown

vercel Bot commented Mar 19, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
mockauth Ready Ready Preview, Comment Mar 19, 2026 1:44pm

Request Review

@casey-brooks
Copy link
Copy Markdown
Contributor Author

Summary:

  • Added token endpoint url/path, content type, and body key order to token exchange diagnostics.
  • Reused body key derivation across proxy callback/token/refresh exchanges.
  • Updated proxy-flow diagnostics expectations.

Sample payload:

{
  "error": "invalid_grant",
  "tokenEndpointUrl": "https://upstream.example.com/oauth2/token",
  "tokenEndpointHost": "upstream.example.com",
  "tokenEndpointPath": "/oauth2/token",
  "contentType": "application/x-www-form-urlencoded",
  "bodyKeys": [
    "grant_type",
    "code",
    "redirect_uri",
    "client_id",
    "code_verifier"
  ],
  "authMethod": "none",
  "includeAuthHeader": false,
  "includeClientSecretInBody": false,
  "client_id": "up-client",
  "redirect_uri": "https://mockauth.test/r/<apiResourceId>/oidc/proxy/callback",
  "grant_type": "authorization_code",
  "code_verifier_present": true
}

Testing:

  • pnpm lint (no errors)
  • pnpm typecheck
  • pnpm test (132 passed)
  • pnpm test:e2e (33 passed)
  • pnpm exec dotenv -e .env.test -o -- pnpm build

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