Skip to content

feat: silent prompt=none and prompt=login re-auth in the hosted authorize UI - #3203

Merged
tada5hi merged 5 commits into
masterfrom
feat/oauth2-prompt-none
Jul 8, 2026
Merged

tada5hi merged 5 commits into
masterfrom
feat/oauth2-prompt-none

Conversation

@tada5hi

@tada5hi tada5hi commented Jul 8, 2026 •

Copy link
Copy Markdown
Collaborator

Plan 042 item 10. Independent of the other branches — off master.

Why it's kit-side, not server-side

The plan sketched a server-side prompt=none error redirect. Investigation showed the server cannot silently authenticate on GET /authorize: the authorization middleware reads the identity only from the Authorization header (and cors.ts explicitly relies on "no cookie-authenticated endpoint exists"), while a top-level browser navigation to /authorize carries no bearer. The session lives client-side (the kit store's cookie). So the decision belongs in the hosted SSR page — Authorize.vue, which every RP (kit or not) is redirected to. This also keeps the header-only-auth invariant intact and avoids the consent-anchor design (plan 043).

The SSR app's router guard await store.resolve()s the session before the page renders, so the kit ladder can trust loggedIn/realmId at mount.

prompt=none (silent)

Evaluated before any interactive UI:

  • not logged in / realm mismatch → redirect redirect_uri?error=login_required&state
  • non-built_in client → consent_required (no persisted consent record yet)
  • built_in + logged-in + realm-match → the existing auto-consent path issues the code silently; a login_required from the POST (max_age/freshness backstop) is redirected as login_required
  • every silent error redirect is gated on redirectUriVerified — an unverified redirect_uri degrades to the interactive UI (never redirect an OIDC error to an unregistered URI)

New AuthorizeSilentRedirect.vue performs the client-only window.location navigation in onMounted (SSR renders a "redirecting" placeholder).

prompt=login (re-auth)

Forces the login form — with a re-auth banner (authupClient.reauthText, added across en/de/fr/es; locale-parity test green) — even for a logged-in user, until a fresh login on this page fires LOGGED_IN. The same banner path replaces the old silent switchAccount when the POST surfaces login_required mid-flow, so a forced re-auth is now explained to the user instead of a bare form flip.

Discovery

Re-adds none to prompt_values_supported (it is now genuinely handled).

Tests

Kit specs: silent redirect per error code (login_required / consent_required), the verified-URI degrade-to-UI gate, the built_in silent-success path, and the prompt=login banner + proceed-on-LOGGED_IN. Discovery e2e updated. Full kit suite (25) + server-core suite (1153) green.

Not in scope (documented): the built_in silent success still relies on the kit's client-side auto-consent trust boundary — a server-side consent record is plan 043.

Summary by CodeRabbit

  • New Features
    • Added prompt-aware authorization handling for silent sign-in (prompt=none) and re-auth (prompt=login).
    • Silent flows now redirect back with appropriate errors when interaction is required.
    • Re-auth forces the sign-in screen and displays a “sign in again” banner.
  • Bug Fixes
    • OIDC discovery now advertises the full supported prompt list, including none.
    • Corrected the advertised revocation endpoint and clarified empty max_age behavior.
  • Documentation
    • Updated OAuth2/OpenID Connect prompt parameter guidance for silent and re-auth behavior.
  • Style
    • Added “sign in again” translations across supported languages.

…rize UI (plan 042)

The server GET /authorize cannot silently authenticate (auth is
header-only; a top-level navigation carries no bearer), so prompt=none is
handled in the hosted SSR kit Authorize.vue — the page every RP is
redirected to — after the router guard resolves the session:

- prompt=none: not-logged-in / realm-mismatch -> redirect
  redirect_uri?error=login_required; non-built_in client ->
  consent_required; built_in + logged-in + realm-match -> the existing
  auto-consent issues the code silently; every error redirect is gated on
  redirectUriVerified (unverified -> degrade to interactive UI, never
  redirect an OIDC error to an unregistered URI). New
  AuthorizeSilentRedirect.vue performs the client-only navigation.
- prompt=login: forces the login form with a re-auth banner
  (authupClient.reauthText, added across all 4 locales) even for a
  logged-in user, until a fresh LOGGED_IN; the same path handles a
  mid-flow login_required (replacing the old silent switchAccount).
- discovery re-adds `none` to prompt_values_supported.

Covered by kit specs (silent redirect per error code, verified-uri gate,
built_in success, re-auth banner) + the discovery e2e.
Copilot AI review requested due to automatic review settings July 8, 2026 10:50

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Jul 8, 2026 •

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

OIDC discovery now advertises none in prompt_values_supported. The hosted SSR Authorize.vue flow handles silent authentication (prompt=none) and forced re-authentication (prompt=login), with a new silent redirect component, AuthorizeForm silent-mode failure handling, translations, and updated docs/tests.

Changes

Silent/Re-auth prompt handling

Layer / File(s) Summary
OIDC discovery prompt_values_supported and docs
apps/server-core/src/adapters/http/controllers/entities/realm/module.ts, apps/server-core/test/unit/http/controllers/entities/realm-openid.spec.ts, docs/src/guide/development/api-oauth2.md, .agents/architecture.md
Discovery metadata advertises none as a supported prompt value; related docs and unit test updates describe silent-auth semantics and the revocation endpoint path correction.
AuthorizeSilentRedirect component
packages/client-web-kit/src/components/workflows/authorize/AuthorizeSilentRedirect.vue
New component builds a redirect URI with OIDC error and optional state query parameters and navigates in the browser while rendering a loading message.
AuthorizeForm silent mode and failed event
packages/client-web-kit/src/components/workflows/authorize/AuthorizeForm.vue, packages/client-web-kit/test/unit/components/workflows/authorize-form-silent.spec.ts
Adds a silent prop and failed emit; silent-mode authorization failures emit failed instead of falling back to the interactive consent UI, with new unit coverage.
Authorize.vue prompt=none/prompt=login core logic
packages/client-web-kit/src/components/workflows/authorize/Authorize.vue
Adds silent and re-auth state, reworks prompt-driven rendering and login-required handling, gates silent consent flow, and wires the new AuthorizeForm props and callbacks.
Authorize.vue silent/reauth test coverage
packages/client-web-kit/test/unit/components/workflows/authorize.spec.ts
Parameterized mount helpers and new suites verify silent redirection behavior and prompt=login re-auth transitions.
REAUTH_TEXT translations
packages/i18n/src/constants.ts, packages/i18n/src/catalogs/{en,de,es,fr}/client.ts
Adds the REAUTH_TEXT translation key and localized strings across English, German, Spanish, and French catalogs.

Estimated code review effort: 4 (Complex) | ~60 minutes

Possibly related PRs

  • authup/authup#3194: Both PRs modify the hosted Authorize.vue flow around realm mismatch and redirectUriVerified handling.
  • authup/authup#3195: Shares direct changes to RealmController.getOpenIdConfiguration for prompt_values_supported and /authorize prompt handling.
  • authup/authup#3197: Also touches the same OIDC discovery prompt_values_supported surface around prompt=none.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: adding prompt=none silent handling and prompt=login re-auth in the hosted authorize UI.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/oauth2-prompt-none

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@tada5hi tada5hi changed the title feat: silent prompt=none and prompt=login re-auth in the hosted authorize UI (plan 042) feat: silent prompt=none and prompt=login re-auth in the hosted authorize UI Jul 8, 2026
@pkg-pr-new

pkg-pr-new Bot commented Jul 8, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

authup

npm i https://pkg.pr.new/authup@3203

@authup/client-web

npm i https://pkg.pr.new/@authup/client-web@3203

@authup/server-core

npm i https://pkg.pr.new/@authup/server-core@3203

@authup/access

npm i https://pkg.pr.new/@authup/access@3203

@authup/client-web-kit

npm i https://pkg.pr.new/@authup/client-web-kit@3203

@authup/client-web-kit-theme

npm i https://pkg.pr.new/@authup/client-web-kit-theme@3203

@authup/client-web-nuxt

npm i https://pkg.pr.new/@authup/client-web-nuxt@3203

@authup/client-web-theme

npm i https://pkg.pr.new/@authup/client-web-theme@3203

@authup/core-http-kit

npm i https://pkg.pr.new/@authup/core-http-kit@3203

@authup/core-kit

npm i https://pkg.pr.new/@authup/core-kit@3203

@authup/core-realtime-kit

npm i https://pkg.pr.new/@authup/core-realtime-kit@3203

@authup/errors

npm i https://pkg.pr.new/@authup/errors@3203

@authup/i18n

npm i https://pkg.pr.new/@authup/i18n@3203

@authup/kit

npm i https://pkg.pr.new/@authup/kit@3203

@authup/server-adapter-kit

npm i https://pkg.pr.new/@authup/server-adapter-kit@3203

@authup/server-adapter-node

npm i https://pkg.pr.new/@authup/server-adapter-node@3203

@authup/server-adapter-socket-io

npm i https://pkg.pr.new/@authup/server-adapter-socket-io@3203

@authup/server-adapter-web

npm i https://pkg.pr.new/@authup/server-adapter-web@3203

@authup/server-kit

npm i https://pkg.pr.new/@authup/server-kit@3203

@authup/server-test-kit

npm i https://pkg.pr.new/@authup/server-test-kit@3203

@authup/specs

npm i https://pkg.pr.new/@authup/specs@3203

commit: 9d11486

…consent UI (audit follow-up)

Under a silent (prompt=none) built_in request, an auto-consent POST
failure other than login_required set autoConsentFailed=true and dropped
to the full interactive manual-consent screen — violating the zero-UI
contract. Add a `silent` prop + `failed` emit to AuthorizeForm: in silent
mode a non-login_required failure emits `failed`, and Authorize.vue
redirects error=interaction_required to the RP. Also removes the unused
REAUTH_TITLE i18n key and documents that prompt=none must be a top-level
navigation (the authorize page denies framing).
@tada5hi

tada5hi commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jul 8, 2026 •

Copy link
Copy Markdown
✅ Action performed

Full review finished.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
packages/client-web-kit/src/components/workflows/authorize/AuthorizeSilentRedirect.vue (1)

37-47: 🔒 Security & Privacy | 🔵 Trivial | 💤 Low value

Consider adding error_description to the redirect URL.

The component sets error and state but omits error_description. While the OIDC spec makes it optional, including a brief description (e.g., matching the error code semantics) helps RPs display meaningful messages to end users. The abort() function in AuthorizeForm.vue (line 101-105) already sets error_description for consistency.

↗️ Optional: add error_description
         onMounted(() => {
             const url = new URL(props.redirectUri);
             url.searchParams.set('error', props.error);
+            url.searchParams.set('error_description', props.error);
             if (props.state) {
                 url.searchParams.set('state', props.state);
             }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@packages/client-web-kit/src/components/workflows/authorize/AuthorizeSilentRedirect.vue`
around lines 37 - 47, The silent redirect flow in AuthorizeSilentRedirect.vue
only forwards error and state, so update the onMounted redirect URL construction
to also set error_description using the same error context as the abort() flow
in AuthorizeForm.vue. Keep the change localized to the URL assembly in
AuthorizeSilentRedirect and ensure the new parameter is included whenever
props.error is present.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In
`@packages/client-web-kit/src/components/workflows/authorize/AuthorizeSilentRedirect.vue`:
- Around line 37-47: The silent redirect flow in AuthorizeSilentRedirect.vue
only forwards error and state, so update the onMounted redirect URL construction
to also set error_description using the same error context as the abort() flow
in AuthorizeForm.vue. Keep the change localized to the URL assembly in
AuthorizeSilentRedirect and ensure the new parameter is included whenever
props.error is present.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 85b6b568-1475-4114-b76a-4d6d58f0579e

📥 Commits

Reviewing files that changed from the base of the PR and between 54bdaf8 and a559919.

📒 Files selected for processing (14)
  • .agents/architecture.md
  • apps/server-core/src/adapters/http/controllers/entities/realm/module.ts
  • apps/server-core/test/unit/http/controllers/entities/realm-openid.spec.ts
  • docs/src/guide/development/api-oauth2.md
  • packages/client-web-kit/src/components/workflows/authorize/Authorize.vue
  • packages/client-web-kit/src/components/workflows/authorize/AuthorizeForm.vue
  • packages/client-web-kit/src/components/workflows/authorize/AuthorizeSilentRedirect.vue
  • packages/client-web-kit/test/unit/components/workflows/authorize-form-silent.spec.ts
  • packages/client-web-kit/test/unit/components/workflows/authorize.spec.ts
  • packages/i18n/src/catalogs/de/client.ts
  • packages/i18n/src/catalogs/en/client.ts
  • packages/i18n/src/catalogs/es/client.ts
  • packages/i18n/src/catalogs/fr/client.ts
  • packages/i18n/src/constants.ts

tada5hi added 2 commits July 8, 2026 16:10
…ent → code redirect)

The built_in silent-success path was only exercised with AuthorizeForm
stubbed. Add a test driving the real AuthorizeForm: built_in + silent +
a successful POST /authorize navigates window.location to the returned
code URL with zero interactive UI — closing the last uncovered branch of
the prompt=none ladder.
…orizeForm

Consistency with the dead-bearer branch: reuse the kit's transport-agnostic
extractErrorContext helper rather than a hand-rolled `(e as {...}).response`
cast for the login_required check.
@tada5hi

tada5hi commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 8, 2026 •

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@tada5hi

tada5hi commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jul 8, 2026 •

Copy link
Copy Markdown
✅ Action performed

Full review finished.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
packages/client-web-kit/test/unit/components/workflows/authorize.spec.ts (1)

239-250: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Consider testing the logged-in + unverified redirect_uri + auto-consent failure path

The existing "degrades to interactive UI" test uses loggedIn: false, which shows the login form. It doesn't cover the edge case where a logged-in user with a built_in client and unverified redirect_uri hits an auto-consent failure — the infinite spinner scenario flagged in Authorize.vue. Since AuthorizeForm is stubbed here, consider adding a test that simulates onFailed emission and asserts the form doesn't get stuck in a spinner state.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/client-web-kit/test/unit/components/workflows/authorize.spec.ts`
around lines 239 - 250, The current `authorize.spec.ts` coverage for the
unverified `redirect_uri` path only exercises the logged-out login form flow and
misses the logged-in auto-consent failure case that can leave `Authorize.vue`
stuck spinning. Add a test in the `mountAuthorize`/`AuthorizeForm` suite that
uses a logged-in built-in client with `redirectUriVerified: false`, triggers the
form’s `onFailed` emission, and asserts the UI recovers from the spinner state
instead of remaining blocked; reference the existing `degrades to interactive UI
when the redirect_uri is not verified` test and the
`silentRedirect`/`AuthorizeForm` stubs when wiring it up.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/client-web-kit/src/components/workflows/authorize/Authorize.vue`:
- Around line 102-111: The silent-flow handling in Authorize.vue can get stuck
on a spinner when redirectUriVerified is false because AuthorizeForm is still
mounted with silent=true and handleLoginRequired always sets silentErrorCode.
Update the Authorize component so the silent prop passed to AuthorizeForm is
gated by redirectUriVerified, and change handleLoginRequired to avoid setting
LOGIN_REQUIRED for unverified redirect URIs so the flow can fall back to the
interactive UI. Keep the fallback logic aligned with silentRedirect, onFailed,
and autoConsentFailed so the form can re-render instead of remaining in the
spinner state.

---

Nitpick comments:
In `@packages/client-web-kit/test/unit/components/workflows/authorize.spec.ts`:
- Around line 239-250: The current `authorize.spec.ts` coverage for the
unverified `redirect_uri` path only exercises the logged-out login form flow and
misses the logged-in auto-consent failure case that can leave `Authorize.vue`
stuck spinning. Add a test in the `mountAuthorize`/`AuthorizeForm` suite that
uses a logged-in built-in client with `redirectUriVerified: false`, triggers the
form’s `onFailed` emission, and asserts the UI recovers from the spinner state
instead of remaining blocked; reference the existing `degrades to interactive UI
when the redirect_uri is not verified` test and the
`silentRedirect`/`AuthorizeForm` stubs when wiring it up.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 6cc9b4bb-da23-439f-b527-995cbe6b4bbc

📥 Commits

Reviewing files that changed from the base of the PR and between 54bdaf8 and 9d11486.

📒 Files selected for processing (14)
  • .agents/architecture.md
  • apps/server-core/src/adapters/http/controllers/entities/realm/module.ts
  • apps/server-core/test/unit/http/controllers/entities/realm-openid.spec.ts
  • docs/src/guide/development/api-oauth2.md
  • packages/client-web-kit/src/components/workflows/authorize/Authorize.vue
  • packages/client-web-kit/src/components/workflows/authorize/AuthorizeForm.vue
  • packages/client-web-kit/src/components/workflows/authorize/AuthorizeSilentRedirect.vue
  • packages/client-web-kit/test/unit/components/workflows/authorize-form-silent.spec.ts
  • packages/client-web-kit/test/unit/components/workflows/authorize.spec.ts
  • packages/i18n/src/catalogs/de/client.ts
  • packages/i18n/src/catalogs/en/client.ts
  • packages/i18n/src/catalogs/es/client.ts
  • packages/i18n/src/catalogs/fr/client.ts
  • packages/i18n/src/constants.ts

@tada5hi

tada5hi commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator Author

@coderabbitai pause

@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown
✅ Action performed

Reviews paused.

…alls back to interactive UI

An unverified redirect_uri cannot receive an OIDC error, so a silent
(prompt=none) auto-consent failure dead-ended on AuthorizeForm's frozen
spinner: the parent set silentErrorCode, silentRedirect() returned null,
and the render fell back to the same still-mounted AuthorizeForm whose
onMounted never re-fired.

Gate the AuthorizeForm `silent` prop and handleLoginRequired's silent
LOGIN_REQUIRED redirect on redirectUriVerified so an unverified URI
degrades to interactive manual consent / the login form, per the
documented contract.
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.

2 participants