Skip to content

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

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

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

Conversation

@mauricioabreu

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.
  • 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 against a dev instance with a SAML connection, before and after, is in progress.

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: a2b16a4

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 21, 2026 9:32pm UTC
swingset Error Error Oct 21, 2026 9:32pm 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.

This branch had an error being deployed

1 failed and 1 active deployments
Preview – swingset — a2b16a46 Deployed Oct 21, 2026 by vercel[bot]
Preview – clerk-js-sandbox — a2b16a46 Deployed Oct 21, 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