Skip to content

feat(oauth): Forward idp_hint to Sentry sign-in - #2448

Merged
dcramer merged 1 commit into
mainfrom
feat/mcp-oauth-idp-hint
Nov 20, 2026
Merged

dcramer merged 1 commit into
mainfrom
feat/mcp-oauth-idp-hint

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

Why: an MCP client sometimes already knows which identity provider a user signs in with. It should be able to say so, so that Sentry can take the user straight to that sign-in instead of its login form. Today Sentry MCP drops any such hint before redirecting to Sentry. Separately, a brand-new user who has to sign in, create a Sentry account and approve consent during a connection can run past the current 10-minute limit on the hop to Sentry and has to start over.

What changes

  • One well-formed idp_hint on /oauth/authorize is kept in the signed consent state. It's forwarded to Sentry only after the user approves on the Sentry MCP consent screen; deny still redirects straight back to the client. Sentry MCP doesn't interpret it: Sentry decides what each value does.
  • A hinted request also sends force_prompt=1, so Sentry always shows its consent screen with the account being connected, even if the user approved before.
  • A missing, repeated, or malformed hint is dropped, and the flow runs as if the client sent none. "Well-formed" means 1–64 characters from [A-Za-z0-9._-]: an identity provider name, never a URL or free text. The hint isn't advertised in metadata.
  • The signed state for the hop to Sentry lasts 30 minutes instead of 10. The consent form's own 10-minute window, which only runs until the user clicks, is unchanged.
  • The intent and rules are recorded in design/mcp-access.md, because idp_hint isn't part of OAuth 2.0 or OpenID Connect.

Nothing breaks. Requests without idp_hint behave as before, apart from the longer state lifetime. RFC 6749 §3.1 requires an authorization server to ignore unrecognized parameters, and Sentry's authorize request validation has no idp_hint field today. So the forwarded hint changes nothing until Sentry gives it a meaning. Dropping a repeated hint follows the same section: parameters "MUST NOT be included more than once". force_prompt is Sentry's own equivalent of OIDC prompt=consent.

The design doc's goals and rules come from the requester's direction.

via @dcramer.

--

View Session [Sentry]

MCP clients can name an identity provider for the user's sign-in with
`idp_hint` on /oauth/authorize. Sentry MCP keeps one well-formed value in
the signed consent state and forwards it to Sentry after approval, along
with force_prompt=1 so a hinted connection always ends on Sentry's consent
screen. A missing, repeated, or malformed hint is dropped. Sentry decides
what each hint value does.

The signed state for the hop to Sentry now lasts 30 minutes, long enough
for a new user to sign in, create an account, and approve consent.

Records the intent and rules in design/mcp-access.md.

Co-Authored-By: David Cramer <23610+dcramer@users.noreply.github.com>
@vercel

vercel Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
cli Ready Ready Preview Nov 20, 2026 7:56pm UTC
sentry-local Ready Ready Preview Nov 20, 2026 7:56pm UTC

Request Review

@dcramer
dcramer marked this pull request as ready for review November 20, 2026 20:00
@dcramer
dcramer requested a review from a team as a code owner November 20, 2026 20:00
@sentry-junior
sentry-junior Bot requested a review from dcramer November 20, 2026 20:00
@github-actions github-actions Bot added the risk: medium PR risk score: medium label Nov 20, 2026
@dcramer
dcramer merged commit 6abf0e3 into main Nov 20, 2026
43 checks passed
@dcramer
dcramer deleted the feat/mcp-oauth-idp-hint branch November 20, 2026 20:12

This branch was successfully deployed

2 active deployments
Preview – cli — c20bc7c7 Deployed Nov 20, 2026 by vercel[bot]
Preview – sentry-local — c20bc7c7 Deployed Nov 20, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: medium PR risk score: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant