Skip to content

fix(auth): bypass SSO for viewer-context requests#113124

Merged
gricha merged 1 commit intomasterfrom
gricha/fix/viewer-context-sso
Apr 16, 2026
Merged

fix(auth): bypass SSO for viewer-context requests#113124
gricha merged 1 commit intomasterfrom
gricha/fix/viewer-context-sso

Conversation

@gricha
Copy link
Copy Markdown
Member

@gricha gricha commented Apr 15, 2026

Bypass the SSO gate for requests authenticated through viewer context.

Seer code mode callbacks authenticate as the acting user via X-Viewer-Context, but Sentry was treating those requests like browser-session auth and enforcing completed SSO state from the Django session. That made callbacks fail with sso-required for orgs that require SSO even though the user identity had already been asserted by a trusted first-party service.

This marks viewer-context-authenticated requests explicitly and lets them skip only the SSO gate while preserving the existing membership-based access checks. It also adds a regression test covering the SSO-required org path so the Seer callback behavior stays covered.

@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Apr 15, 2026
@gricha
Copy link
Copy Markdown
Member Author

gricha commented Apr 15, 2026

Note - this is only for internal requests that already have a form of trust established either via:

  • External request with proper session-based auth (and SSO gate cleared) has started the upstream request and it was passed around.
  • Inter-service communication (though that won't really even happen right now).

To ensure this isn't exploitable from the outside we are also stripping X-Viewer-Context on nginx ingress.

@gricha gricha marked this pull request as ready for review April 15, 2026 21:30
@gricha gricha requested review from a team as code owners April 15, 2026 21:30
@gricha gricha requested a review from azulus April 15, 2026 21:30
@gricha gricha force-pushed the gricha/fix/viewer-context-sso branch from 9c118d9 to 0b95e42 Compare April 15, 2026 21:30
Viewer-context authentication is used by Seer code mode callbacks, but the
request was treated like a browser session and forced through the SSO
gate for SSO-required orgs.

Mark viewer-context-authenticated requests explicitly and let them skip
only the SSO requirement while keeping normal membership-based access
checks intact. Add a regression test covering the SSO-required org path.

Co-Authored-By: OpenAI Codex <noreply@openai.com>
@gricha gricha merged commit 794e1eb into master Apr 16, 2026
77 checks passed
@gricha gricha deleted the gricha/fix/viewer-context-sso branch April 16, 2026 00:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants