Skip to content

fix(mcp): mcp claims mapping parser - #36171

Merged
Vishnuujain merged 1 commit into
mainfrom
fix/mcp-claims-colon
Oct 26, 2026
Merged

Vishnuujain merged 1 commit into
mainfrom
fix/mcp-claims-colon

Conversation

@Vishnuujain

@Vishnuujain Vishnuujain commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Describe your changes:

Part of a larger set of MCP and auth fixes.

  • McpCallbackServlet parsed jwtPrincipalClaimsMapping with its own split on every colon, so a mapped claim name like custom:login was dropped and MCP resolved the user from the claim order instead, unlike web login.
  • It now uses SecurityUtil.buildPrincipalClaimsMapping, the same parser JwtFilter and web login use.

Type of change:

  • Bug fix

Tests:

Unit tests

  • McpCallbackServletTest#getClaimsMapping_keepsClaimNamesThatContainAColon checks username and email; it fails without the fix.
  • All openmetadata-mcp unit tests pass locally (803).

Backend integration tests

Not run locally (49 classes selected); the merge queue runs them.

Checklist:

  • I have read the CONTRIBUTING document.
  • I have commented on my code, particularly in hard-to-understand areas.
  • I have added tests (unit / integration / Playwright as applicable) and listed them above.
  • Self-review: I reviewed the final diff against REVIEW.md (the pr-checklist skill runs it) and fixed every 🔴 finding, or answered it on the line below.
    Reviewed ec3628e: no 🔴. One 🟡 left for a follow-up: the auth settings validator in SystemRepository still has its own split; it does not change the result today.
  • Decision check: not needed, it reuses the existing shared parser.
  • I have added a test that covers the exact scenario we are fixing.

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge.

Summary

McpCallbackServlet now uses SecurityUtil.buildPrincipalClaimsMapping, matching web login.

  • MCP sign-in keeps mapped claim names that contain colons.

Acknowledgment: Vishnuujain deferred updating the separate parser in SystemRepository, stating that it does not change the result today.

Reviews (1) · Last reviewed commit: "fix(mcp): mcp claims mapping parser" · Reviewed by Greptile

@github-actions

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This PR cannot be merged until the following are addressed on its linked issue:

  • No GitHub issue is linked. Link an issue in the Development section of the PR (or add Fixes #12345 to the description). For a same-org cross-repo issue, add Fixes open-metadata/<repo>#123 to the description.

The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically.

Maintainers can bypass this check by adding the skip-pr-checks label.

@github-actions github-actions Bot added the safe to test Add this label to run secure Github workflows on PRs label Oct 25, 2026
@gitar-bot

gitar-bot Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Code Review ✅ Approved

🔴 High risk · MCP login now honors colon-containing configured identity claims, which could resolve a session to an unintended account if mappings or claims are wrong.

Switches McpCallbackServlet to the shared SecurityUtil.buildPrincipalClaimsMapping parser so claim names containing colons, such as custom:login, are no longer dropped and MCP resolves users the same way as web login. No issues found.

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Not enabled

Set up

For more verification details, comment gitar display:verbose.

Options

Display: compact → Showing compact verification results.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

@Vishnuujain Vishnuujain self-assigned this Oct 25, 2026
@Vishnuujain Vishnuujain added the To release Will cherry-pick this PR into the release branch label Oct 25, 2026
@Vishnuujain
Vishnuujain added this pull request to the merge queue Oct 26, 2026
Merged via the queue into main with commit e9d0281 Oct 26, 2026
121 of 123 checks passed
@Vishnuujain
Vishnuujain deleted the fix/mcp-claims-colon branch October 26, 2026 08:09
@github-actions

Copy link
Copy Markdown
Contributor

🤖 Backport to 2.0 is under way. It is built from openmetadata-collate, which holds the credentials needed to open a PR here, and it will comment again with the result — nothing is needed from you unless it reports otherwise.

@gh-bot-collate

Copy link
Copy Markdown

🤖 Backport to 2.0 opened as #36213. Claude resolved a cherry-pick conflict to build it. It merges itself once the checks pass, so read the diff now if this change is a sensitive one.

Vishnuujain added a commit that referenced this pull request Oct 26, 2026
(cherry picked from commit e9d0281)

Co-authored-by: Vishnu Jain <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe to test Add this label to run secure Github workflows on PRs To release Will cherry-pick this PR into the release branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants