Kong/insomnia · error

Code verifier not set

Error message

Code verifier not set

What it means

PKCE guard in the MCP OAuth provider's codeVerifier(): the stored code verifier is unset because saveCodeVerifier was never called (or the flow restarted), so the PKCE code_challenge handshake cannot be completed.

Solutions

  1. Restart the OAuth flow so the verifier is generated and saved first
  2. Ensure authorization and token exchange use the same provider instance
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at packages/insomnia/src/main/mcp/oauth-client-provider.ts:206 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of Kong/insomnia@d9bb2b0142 (2026-08-26). Data as JSON: /api/errors/95d4b52908ff0813. Report an issue: GitHub.

Appendix: source

Thrown at packages/insomnia/src/main/mcp/oauth-client-provider.ts:206

    if (error) {
      throw new Error(JSON.stringify({ error, error_description, error_uri }));
    } else if (!authorizationCode) {
      throw new Error('Authorization code not found');
    }
    await this._redirectEndListener?.(authorizationCode);
  }
  onRedirectEnd(listener: (authorizationCode: string) => void) {
    this._redirectEndListener = listener;
    return () => {
      this._redirectEndListener = null;
    };
  }
  async saveCodeVerifier(codeVerifier: string) {
    this._codeVerifier = codeVerifier;
  }
  async codeVerifier() {
    if (!this._codeVerifier) {
      throw new Error('Code verifier not set');
    }
    return this._codeVerifier;
  }
}

View on GitHub (pinned to d9bb2b0142)