Skip to content

Show OAuth auth response bodies in Network tab, with sensitive-field masking + reveal toggle #1386

Description

@cliffhall

Problem

auth-category Network entries show request body, headers, and status, but no response body (renders (empty) even when content-length says otherwise). This is deliberate today — buildEffectiveAuthFetch (core/mcp/inspectorClient.ts) does not wire updateResponseBody to avoid surfacing access_token/refresh_token in the body preview (screen-share leak). But it means the OAuth token-exchange response (the most useful thing to inspect when debugging auth) is never visible.

Change

Capture auth response bodies and display them, but mask sensitive OAuth fields by default behind a click-to-reveal toggle:

  1. buildEffectiveAuthFetch — wire updateResponseBody so auth response bodies are captured (mirrors the transport fetcher).
  2. New maskSecretsInBody util — masks access_token, refresh_token, id_token, client_secret values in JSON bodies; returns whether anything was masked.
  3. NetworkEntry's BodyPreview — when a body contains masked fields, render it masked with a "Reveal"/"Hide" toggle. Copy honors the current (masked vs raw) view.

Notes

Acceptance criteria

  • A successful /token exchange shows its JSON response body in Network, with access_token/refresh_token masked until revealed.
  • Non-sensitive bodies (e.g. discovery metadata) show fully with no toggle.
  • No regression to transport-entry body display.

Metadata

Metadata

Assignees

Labels

authIssues and PRs related to authorizationv2Issues and PRs for v2

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions