Skip to content

fix: allow empty client_secret for MCP OAuth configuration#12685

Open
reverb256 wants to merge 1 commit intodanny-avila:mainfrom
reverb256:fix/12460-mcp-oauth-optional-client-secret
Open

fix: allow empty client_secret for MCP OAuth configuration#12685
reverb256 wants to merge 1 commit intodanny-avila:mainfrom
reverb256:fix/12460-mcp-oauth-optional-client-secret

Conversation

@reverb256
Copy link
Copy Markdown

Summary

Some OAuth providers (e.g., public clients using PKCE per RFC 7636) do not require a client_secret. The backend Zod schema (MCPServerUserInputSchema) already treats client_secret as optional, but the MCP server creation form enforced it as required in create mode.

This aligns the frontend validation with the backend by making the field optional in create mode, with an (optional) placeholder hint.

Closes #12460

Changes

  • AuthSection.tsx: Removed required: !isEditMode validation from oauth_client_secret field. Removed asterisk marker and error UI. Added (optional) placeholder in create mode using existing com_ui_optional i18n key.
  • mcp.spec.ts: Added 3 backend schema tests confirming client_secret is optional (public client without secret, with secret, and client_id-only scenarios).

Verification

  • 18/18 tests passing
  • Biome check clean

…la#12460)

Some OAuth providers (public clients using PKCE per RFC 7636) do not
require a client_secret. The backend Zod schema
(MCPServerUserInputSchema) already treats client_secret as optional,
but the frontend form enforced it as required in create mode.

Changes:
- Remove required validation from oauth_client_secret field in
  AuthSection.tsx
- Remove associated required asterisk and error message UI
- Add '(optional)' placeholder for the field in create mode
- Add backend tests confirming client_secret is optional in
  MCPServerUserInputSchema (accepts with and without client_secret)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant