Skip to content

fix(auth): accept connector token context without ID token - #52

Merged
speterkins merged 1 commit into
mainfrom
kdodaj/fix-mcp-connector-token-context
Jul 4, 2026
Merged

speterkins merged 1 commit into
mainfrom
kdodaj/fix-mcp-connector-token-context

Conversation

@kristidodaj-cohere

@kristidodaj-cohere kristidodaj-cohere commented Jul 3, 2026 •

Copy link
Copy Markdown
Contributor

What changed

  • Allows open MCP auth mode to parse X-North connector token context even when X-North-ID-Token is absent.
  • Keeps X-North-ID-Token required when trusted_issuers are configured.
  • Bumps the SDK package version to 0.4.3 for 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.py
  • uv run ruff check src/north_mcp_python_sdk/auth.py tests/test_x_north_auth_backend.py tests/test_x_north_trusted_issuers.py

Reviewer focus

  • The require_id_token=False path is only used when no auth is configured; servers with trusted_issuers still 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) without X-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 with require_id_token=False, building an AuthenticatedUser with empty ID token, fallback email, and parsed connector tokens. X-North-User-Email alone also counts as an X-North header for this path.

When trusted_issuers are set, behavior is unchanged: X-North-ID-Token is still required; connector-token-only requests still raise no 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.

@kristidodaj-cohere
kristidodaj-cohere marked this pull request as ready for review July 3, 2026 20:12
@speterkins
speterkins added this pull request to the merge queue Jul 4, 2026
Merged via the queue into main with commit 59e2f69 Jul 4, 2026
4 checks passed
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.

3 participants