OMCP OAuth Lab

DEBUGGING ORDER

Debug the MCP OAuth chain from the resource outward.

Start with the first authoritative mismatch instead of changing redirect URLs, scopes, and client settings simultaneously.

1. Protected resource response

Confirm the MCP resource and its authentication challenge lead the client to the expected protected resource metadata. Verify scheme, host, port, path, and cache behavior through the public proxy.

2. Authorization server identity

Fetch the advertised issuer's metadata and compare issuer exactly. Inspect authorization, token, registration, and JWKS endpoints for HTTPS and unexpected cross-domain redirects.

3. Client onboarding

Determine whether the client uses pre-registration, dynamic registration, or client ID metadata documents. A missing registration endpoint may be intentional, but then the client must already be known.

4. Redirect and PKCE

Compare the redirect URI byte for byte across registration, authorization, and token exchange. Verify the code challenge uses S256 and the verifier belongs to the same transaction.

5. Token validation

Validate signature, issuer, audience/resource, expiry, scopes, and token type. A successfully issued token is not automatically valid for the MCP resource.

6. Authorization behavior

Test insufficient scope, wrong audience, expired tokens, invalid signatures, missing credentials, and unauthorized tools. Observe both HTTP responses and MCP-level errors.