Repository navigation
feat(oauth): Forward the OIDC prompt from the authorize page - #130413
Open
sentry-junior[bot] wants to merge 3 commits into
Open
sentry-junior[bot] wants to merge 3 commits into
sentry-junior[bot] wants to merge 3 commits into
Conversation
Pass the prompt parameter to authorization context and consent preparation so the server can enforce it. When the server asks a prompt=login request to reauthenticate, sign out and show the sign-in form, so the existing session cannot satisfy it. Signing in prepares consent again for the new session. Co-Authored-By: BYK <126780+BYK@users.noreply.github.com>
…mpt-frontend # Conflicts: # static/app/views/authV2/oauth/queries.ts # static/app/views/authV2/oauthAuthorize/useOAuthAuthorizeFlow.ts
Contributor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit f3cc8b3. Configure here.
Start over kept the switchAccount mutation error, so the next reauthenticate response showed the same error again before sign-out was retried.
This branch was successfully deployed
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.

This is the frontend half of standard OIDC
promptsupport on/oauth/authorize/. The server enforcement is in #130412. It is approach D from getsentry/toolkit#1925.The authorize page now forwards
promptto authorization context and consent preparation. Everything else follows from what the server returns:consent/select_account: the server reports no existing consent, so the page shows the consent step with Switch account instead of approving silently. No frontend logic was added.force_promptstill works as before.login: when consent preparation returns{"stage": "reauthenticate"}, the page signs out through the same path as Switch account and shows the sign-in form. That way the existing session can't satisfy the request. Signing in starts a new session, and consent is prepared again. If sign-out fails, the page shows the error with Start over.none: the server redirects withlogin_required/consent_required/interaction_required/invalid_request, or the existing auto-approve path runs. The page only shows its loading state.Either PR can merge first. Without #130412, the server ignores
prompt, which is today's behavior.Screenshots (local devserver with both PRs, app already approved for
project:read)prompt=select_account(before: approved silently, no UI)prompt=loginafter the session's sign-in is over 60s oldI also checked these locally without screenshots, since no UI renders:
prompt=nonewhile signed out went tocallback?error=login_required&state=xyz. With an unapproved scope it went toerror=consent_required. With existing consent it went tocallback?code=…&state=xyz.prompt=none loginwent toerror=invalid_request. After signing in again from theprompt=loginform, the page went straight tocallback?code=….The
prompt=logindesign (60-second sign-in window, re-auth by signing out) is settled in #130412.via @BYK.
--
View Session in Sentry