Skip to content

MCP sign-in fails when SSO is configured as a public client #38480

Done

Description

@Vishnuujain
  • With an OIDC provider set up as a public client, connecting an MCP client ends with error=authorization_failed ("SSO authorization failed") instead of a login page. The identity provider is never contacted.
  • The server-side login that MCP sign-in hands over to is only built for confidential clients:
    if (ClientType.CONFIDENTIAL.equals(authConfig.getClientType())) {
    try {
    AuthenticationCodeFlowHandler handler =
    new AuthenticationCodeFlowHandler(authConfig, authzConfig, sessionService);
    LOG.info(
    "Successfully initialized AuthenticationCodeFlowHandler for provider: {}",
    provider);
    return handler;
    } catch (Exception e) {
    LOG.error(
    "Failed to initialize AuthenticationCodeFlowHandler for provider: {}. "
    + "SSO will not be available. Error: {}",
    provider,
    e.getMessage(),
    e);
    return NoopAuthServeletHandler.getInstance();
    }
    }
    LOG.warn(
    "OIDC provider {} requires CONFIDENTIAL client type, but got: {}. "
    + "Set AUTHENTICATION_CLIENT_TYPE=confidential to enable SSO.",
    provider,
    authConfig.getClientType());
    return NoopAuthServeletHandler.getInstance();
  • Personal access tokens still work on /mcp there. gapPublicOidcClientCannotSignIn in test(mcp): run a real mcp sign-in for recorded client profiles #38440 pins today's behaviour.

Activity

  1. self-assigned this
    on Nov 25, 2026
  2. moved this to In Review / QA 👀 in Shippingon Nov 27, 2026
  3. moved this from In Review / QA 👀 to Done ✅ in Shippingon Nov 27, 2026
  4. added a commit that references this issue on Nov 27, 2026
    0ea3fea
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

  • Status
    Done ✅

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions