Skip to content

feat(ui,clerk-js,shared,localizations): Offer enterprise SSO in the reverification modal - #10346

Draft
mauricioabreu wants to merge 4 commits into
mainfrom
mauricio-antunes/orgs-1939-reverification-enterprise-sso
Draft

mauricioabreu wants to merge 4 commits into
mainfrom
mauricio-antunes/orgs-1939-reverification-enterprise-sso

Conversation

@mauricioabreu

@mauricioabreu mauricioabreu commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Context

Reverification asks a signed-in user to prove it is still them before a sensitive action. For a user who signed in through enterprise SSO, the Frontend API lists enterprise_sso among the supported first factors, but the prebuilt modal in @clerk/ui filters that strategy out. A user with no password, phone or email code gets "Cannot verify your account" and is stuck. OpenRouter hit this with SAML and OIDC users.

Why

The SDK already supports the flow: session.prepareFirstFactorVerification({ strategy: 'enterprise_sso' }) returns the identity provider URL, and custom UIs can use it today. Only the modal was missing. The round trip runs in a popup because useReverification keeps the pending action in memory; a full-page redirect would verify the user but drop the action they were trying to perform. The popup reuses the Account Portal /popup-callback page that OAuth sign-in popups already rely on.

How

Expand
  • enterprise_sso joins the modal's supported first factors. An SSO-only user lands on a card with one button per enterprise connection (reusing ChooseEnterpriseConnectionCard); a user with a password sees "Continue with <connection>" under "Use another method".
  • Clicking a connection opens a popup synchronously, calls prepareFirstFactorVerification with redirect_url and action_complete_redirect_url pointing at the Account Portal popup callback, and navigates the popup to the IdP URL. When the callback posts back, the modal refreshes the session token and resolves afterVerification, so the original action resumes without a reload. For a multi_factor level it moves on to the second factor instead.
  • If the browser blocks the popup, both URLs point at the current page and the modal does a full-page redirect. The user comes back verified and the next attempt passes without a prompt. Apps can also ask for the redirect up front with oauthFlow: 'redirect' on useReverification or on the modal props; 'auto' follows the sign-in heuristic and 'popup' stays the default.
  • Session.prepareFirstFactorVerification now forwards actionCompleteRedirectUrl for enterprise_sso, and the prepare params type accepts it as optional.
  • New localization keys: reverification.enterpriseSSO.{title,subtitle} and reverification.alternativeMethods.blockButton__enterpriseSSO. Other locales regenerated in a separate commit.

Known limitation: the Account Portal callback posts the same message whether the IdP round trip succeeded or failed, so a failed round trip resolves the modal and the retried action asks for reverification again.

Testing

Expand
  • Unit tests in UVFactorOne.test.tsx: SSO-only user sees the connection button; two connections give two buttons; password plus SSO lists SSO under "Use another method"; blocked popup falls back to a redirect with the prepare params; popup callback message completes the verification.
  • pnpm --filter @clerk/ui test for UserVerification and SignIn, lint and format for ui, shared, clerk-js, localizations.
  • Manual run on a local clerk_go stack from the backend branch (clerk/clerk_go#23323) with the mock SAML and OIDC IdPs: a SAML user and an OIDC user each complete the popup round trip and the pending action resumes without a reload; with popups blocked the page redirects, comes back verified, and the next attempt passes without a prompt. The published bundle shows "Cannot verify your account" for the same users.

Checklist

  • pnpm test runs as expected.
  • pnpm build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other:

Part of ORGS-1939

…everification modal

The modal dropped enterprise_sso from the supported first factors, so a
user whose only factor is an identity provider got "no available
methods". It now shows a button per enterprise connection, runs the IdP
round trip in a popup that reports back through the Account Portal
popup callback, and falls back to a full-page redirect when the popup
is blocked.
@changeset-bot

changeset-bot Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: f0df639

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 23 packages
Name Type
@clerk/ui Minor
@clerk/clerk-js Patch
@clerk/shared Patch
@clerk/localizations Patch
@clerk/astro Patch
@clerk/chrome-extension Patch
@clerk/react Patch
@clerk/vue Patch
@clerk/electron Patch
@clerk/expo Patch
@clerk/mosaic Patch
@clerk/backend Patch
@clerk/expo-passkeys Patch
@clerk/express Patch
@clerk/fastify Patch
@clerk/hono Patch
@clerk/msw Patch
@clerk/nextjs Patch
@clerk/nuxt Patch
@clerk/react-router Patch
@clerk/swingset Patch
@clerk/tanstack-react-start Patch
@clerk/testing Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel

vercel Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
clerk-js-sandbox Ready Ready Preview Oct 26, 2026 8:43pm UTC
swingset Error Error Oct 26, 2026 8:43pm UTC

Request Review

@coderabbitai

coderabbitai Bot commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

…rification

Without it, a user who picks their enterprise connection in the
reverification modal gets an error instead of being sent to the identity
provider, because FAPI rejects the prepare call. Resolve the email address
from the enterprise account tied to the chosen connection, fall back to the
primary email, and close the popup when the prepare call fails.

Part of ORGS-1939
@pkg-pr-new

pkg-pr-new Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

@clerk/astro

npm i https://pkg.pr.new/@clerk/astro@10346

@clerk/backend

npm i https://pkg.pr.new/@clerk/backend@10346

@clerk/chrome-extension

npm i https://pkg.pr.new/@clerk/chrome-extension@10346

@clerk/clerk-js

npm i https://pkg.pr.new/@clerk/clerk-js@10346

@clerk/electron

npm i https://pkg.pr.new/@clerk/electron@10346

@clerk/electron-passkeys

npm i https://pkg.pr.new/@clerk/electron-passkeys@10346

@clerk/eslint-plugin

npm i https://pkg.pr.new/@clerk/eslint-plugin@10346

@clerk/expo

npm i https://pkg.pr.new/@clerk/expo@10346

@clerk/expo-biometrics

npm i https://pkg.pr.new/@clerk/expo-biometrics@10346

@clerk/expo-google-signin

npm i https://pkg.pr.new/@clerk/expo-google-signin@10346

@clerk/expo-native-components

npm i https://pkg.pr.new/@clerk/expo-native-components@10346

@clerk/expo-passkeys

npm i https://pkg.pr.new/@clerk/expo-passkeys@10346

@clerk/express

npm i https://pkg.pr.new/@clerk/express@10346

@clerk/fastify

npm i https://pkg.pr.new/@clerk/fastify@10346

@clerk/hono

npm i https://pkg.pr.new/@clerk/hono@10346

@clerk/localizations

npm i https://pkg.pr.new/@clerk/localizations@10346

@clerk/mosaic

npm i https://pkg.pr.new/@clerk/mosaic@10346

@clerk/nextjs

npm i https://pkg.pr.new/@clerk/nextjs@10346

@clerk/nuxt

npm i https://pkg.pr.new/@clerk/nuxt@10346

@clerk/react

npm i https://pkg.pr.new/@clerk/react@10346

@clerk/react-router

npm i https://pkg.pr.new/@clerk/react-router@10346

@clerk/shared

npm i https://pkg.pr.new/@clerk/shared@10346

@clerk/tanstack-react-start

npm i https://pkg.pr.new/@clerk/tanstack-react-start@10346

@clerk/testing

npm i https://pkg.pr.new/@clerk/testing@10346

@clerk/ui

npm i https://pkg.pr.new/@clerk/ui@10346

@clerk/upgrade

npm i https://pkg.pr.new/@clerk/upgrade@10346

@clerk/vue

npm i https://pkg.pr.new/@clerk/vue@10346

commit: f0df639

…rise SSO reverification

Some apps cannot or do not want to open a popup for the identity provider
round trip, and today the modal only falls back to a redirect when the
browser blocks the popup. `oauthFlow` on `useReverification` and on the
reverification modal props now accepts 'popup' (the default), 'redirect'
or 'auto', the same values the sign-in component takes. With 'redirect'
the modal sends the page to the IdP and the user comes back verified.

Part of ORGS-1939

This branch had an error being deployed

1 failed and 1 active deployments
Preview – swingset — f0df639d Deployed Oct 26, 2026 by vercel[bot]
Preview – clerk-js-sandbox — f0df639d Deployed Oct 26, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant