Repository navigation
fix(auth): accept connector token context without ID token - #52
Merged
Merged
Conversation
kristidodaj-cohere
marked this pull request as ready for review
July 3, 2026 20:12
sherv-cohere
approved these changes
Jul 3, 2026
speterkins
approved these changes
Jul 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
X-North-ID-Tokenis absent.X-North-ID-Tokenrequired whentrusted_issuersare configured.0.4.3for downstream MCP server consumption.Context
North can send connector tokens for an MCP request without also sending an ID token when the effective user does not resolve to a Dex ID token. After server-secret support was removed, that request shape caused the SDK to enter the X-North auth path and then reject the request because it still required
X-North-ID-Token.For open/internal MCP servers without
trusted_issuers, the middleware is acting as a North request-context parser rather than enforcing cryptographic ID-token auth. This keeps strict behavior for configured issuers while allowing connector-token-backed tools to receive their context.How to verify
uv run pytest tests/test_x_north_auth_backend.py tests/test_x_north_trusted_issuers.pyuv run ruff check src/north_mcp_python_sdk/auth.py tests/test_x_north_auth_backend.py tests/test_x_north_trusted_issuers.pyReviewer focus
require_id_token=Falsepath is only used when no auth is configured; servers withtrusted_issuersstill reject connector-token-only requests.Note
Medium Risk
Relaxes authentication requirements on the open-auth path only, but still allows unverified connector/email context to reach tools—appropriate for internal parsers but worth confirming deployment assumptions.
Overview
Fixes North MCP requests that ship connector tokens (and optional
X-North-User-Email) withoutX-North-ID-Token, which were failing after server-secret auth was removed.In open auth (no
trusted_issuers), the backend now parses X-North context withrequire_id_token=False, building anAuthenticatedUserwith empty ID token, fallback email, and parsed connector tokens.X-North-User-Emailalone also counts as an X-North header for this path.When
trusted_issuersare set, behavior is unchanged:X-North-ID-Tokenis still required; connector-token-only requests still raiseno authentication headers present.Package version is bumped to 0.4.3 (lockfile updated).
Reviewed by Cursor Bugbot for commit 43b71c8. Bugbot is set up for automated code reviews on this repo. Configure here.