{"record":{"id":"f8d914d5b2178ca4","repo":"different-ai/openwork","slug":"mcp-oauth-issuer-mismatch-f8d914","errorCode":"MCP_OAUTH_ISSUER_MISMATCH","errorMessage":"The OAuth authorization server does not match the issuer selected for this MCP connection.","messagePattern":"The OAuth authorization server does not match the issuer selected for this MCP connection\\.","errorType":"exception","errorClass":"EnterpriseMcpOAuthContractError","httpStatus":null,"severity":"error","filePath":"packages/enterprise-mcp-client/src/oauth-provider.ts","lineNumber":173,"sourceCode":"      token_endpoint_auth_method: \"none\",\n      application_type: this.applicationType,\n      ...(scope ? { scope } : {}),\n    }\n  }\n\n  private assertDiscoveryBinding(state: OAuthDiscoveryState): void {\n    const selectedIssuer = this.authorizationServerIssuer\n    if (!selectedIssuer) {\n      if ((state.resourceMetadata?.authorization_servers?.length ?? 0) > 1) {\n        throw new EnterpriseMcpOAuthContractError(\n          \"MCP_OAUTH_CONFIGURATION_REQUIRED\",\n          \"This MCP resource advertises multiple authorization servers; an administrator must select one before connecting.\",\n        )\n      }\n      return\n    }\n    if (!isAuthorizationServerDiscoveryBound(state, selectedIssuer)) {\n      throw new EnterpriseMcpOAuthContractError(\n        \"MCP_OAUTH_ISSUER_MISMATCH\",\n        \"The OAuth authorization server does not match the issuer selected for this MCP connection.\",\n      )\n    }\n  }\n\n  private expectedCredentialIssuer(context?: OAuthClientInformationContext): string | undefined {\n    const boundIssuer = this.authorizationServerIssuer\n      ?? this.loadedDiscovery?.authorizationServerMetadata?.issuer\n      ?? this.loadedDiscovery?.authorizationServerUrl\n    if (context?.issuer && boundIssuer && !isEquivalentOAuthDiscoveryAlias(context.issuer, boundIssuer)) {\n      throw new EnterpriseMcpOAuthContractError(\n        \"MCP_OAUTH_ISSUER_MISMATCH\",\n        \"The OAuth credential context does not match the selected authorization server issuer.\",\n      )\n    }\n    return boundIssuer ?? context?.issuer\n  }","sourceCodeStart":155,"sourceCodeEnd":191,"githubUrl":"https://github.com/different-ai/openwork/blob/2b7df46e8ae1517d64c896c7793d2d52ec845669/packages/enterprise-mcp-client/src/oauth-provider.ts#L155-L191","documentation":"Error \"The OAuth authorization server does not match the issuer selected for this MCP connection.\" thrown in different-ai/openwork.","triggerScenarios":"Thrown at packages/enterprise-mcp-client/src/oauth-provider.ts:173 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2b7df46e8ae1517d64c896c7793d2d52ec845669","analyzedAt":"2026-09-01T07:59:23.713Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}