Repository navigation
fix(mcp): show access denied for accounts not allowed - #38259
Conversation
|
Local Java test run: PASSED — details
Tests run locally
Broader coverage not executed by this focused run
Impacted, not run locally (2)
Commandsmvn -B package -pl openmetadata-mcp,openmetadata-service -am -Dspring-boot.repackage.skip=true -Dtest=AuthenticationCodeFlowHandlerTest,McpCallbackServletTest,UserSSOOAuthProviderTest -Dsurefire.failIfNoSpecifiedTests=false |
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
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 |
Code Review ✅ Approved 🟡 Medium risk 1 closed / 1 findingsMCP callbacks now map refused SSO accounts to 403 Access Denied instead of 500, changing client-visible sign-in failure handling without granting access. Refused MCP sign-ins for accounts not allowed to sign in now show an Access Denied page with a 403 instead of an internal error, with the login step's own status unchanged. The previously unrecorded ADR rule for this MCP 403 behavior was addressed. No open issues found. ✅ 1 closed✅ Quality: MCP 403 rule for refused accounts isn't recorded in any ADR
VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledFor more verification details, comment OptionsDisplay: compact → Showing compact verification results. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
Describe your changes:
Fixes #38255
ADR:2026-11-12-a-failed-sso-sign-in-returns-to-the-sign-in-pagesays.Type of change:
High-level design:
N/A, small change.
Tests:
Use cases covered
Unit tests
McpCallbackServletTest(doGet_accountNotAllowed_showsAccessDeniedNotAnInternalError),AuthenticationCodeFlowHandlerTest(handleCallback_failedMcpSignIn_tellsItsCallbackWhy).Backend integration tests
Local Java test run: PASSED
eff62bbe3467(baseorigin/main)--scope full).Manual testing performed
PUT /api/v1/system/security/config./mcp/authorizeas a person who has no account.Checklist:
Fixes #<issue-number>above.REVIEW.mdand fixed every 🔴 finding, or answered it on the line below.eff62bbe346. No 🔴.ADR:2026-11-12-a-failed-sso-sign-in-returns-to-the-sign-in-pagegets a v2 amendment with the rule for the MCP callback.

Confidence Score: 5/5
The PR appears safe to merge; no actionable issues were found.Summary
Refused MCP sign-ins now show Access Denied with HTTP 403 instead of an internal-error page.
No actionable issues found. Tests were not run during this review.
Diagram
%%{init: {'theme': 'neutral'}}%% flowchart TD A[MCP SSO callback] --> B[Run sign-in handler] B --> C{Account not allowed?} C -->|Yes| D[403 Access Denied] C -->|Other failure| E[Existing error page] C -->|Sign-in succeeds| F[Existing token checks and consent]Reviews (7) · Last reviewed commit: "Merge branch 'main' into mcp-unknown-use..." · Reviewed by Greptile