Repository navigation
feat(mosaic): sign up with enterprise SSO - #11022
Draft
austincalvelage wants to merge 6 commits into
Draft
austincalvelage wants to merge 6 commits into
austincalvelage wants to merge 6 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: 460dbeb The changes in this PR will be included in the next version bump. This PR includes changesets to release 0 packagesWhen changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types 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 |
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
|
@clerk/astro
@clerk/backend
@clerk/chrome-extension
@clerk/clerk-js
@clerk/electron
@clerk/electron-passkeys
@clerk/eslint-plugin
@clerk/expo
@clerk/expo-biometrics
@clerk/expo-google-signin
@clerk/expo-native-components
@clerk/expo-passkeys
@clerk/express
@clerk/fastify
@clerk/hono
@clerk/localizations
@clerk/mosaic
@clerk/nextjs
@clerk/nuxt
@clerk/react
@clerk/react-router
@clerk/shared
@clerk/tanstack-react-start
@clerk/testing
@clerk/ui
@clerk/upgrade
@clerk/vue
commit: |
austincalvelage
force-pushed
the
austin/mosaic-sign-up-enterprise-sso
branch
from
November 26, 2026 08:07
40f72ce to
8d34792
Compare
austincalvelage
force-pushed
the
austin/mosaic-sign-up-enterprise-sso
branch
from
November 30, 2026 07:00
8d34792 to
c83ab33
Compare
austincalvelage
force-pushed
the
austin/mosaic-sign-up-enterprise-sso
branch
from
November 30, 2026 20:29
c83ab33 to
1dfd5f5
Compare
austincalvelage
force-pushed
the
austin/mosaic-sign-up-enterprise-sso
branch
from
November 30, 2026 20:32
1dfd5f5 to
7ea1f73
Compare
austincalvelage
force-pushed
the
austin/mosaic-sign-up-enterprise-sso
branch
from
November 30, 2026 21:08
47a0838 to
5b907cb
Compare
1 of 9 tasks
austincalvelage
force-pushed
the
austin/mosaic-sign-up-enterprise-sso
branch
from
December 2, 2026 05:05
5b907cb to
fba1d2f
Compare
austincalvelage
force-pushed
the
austin/mosaic-sign-up-enterprise-sso
branch
from
December 2, 2026 05:49
fba1d2f to
9ddadb1
Compare
austincalvelage
force-pushed
the
austin/mosaic-sign-up-enterprise-sso
branch
from
December 2, 2026 06:29
9ddadb1 to
89ecf89
Compare
austincalvelage
force-pushed
the
austin/mosaic-sign-up-enterprise-sso
branch
from
December 2, 2026 06:52
89ecf89 to
74cce81
Compare
An email whose domain belongs to an enterprise connection used to end on Start over. Sign-up now sends the browser to the identity provider from the sign-up it already has, so the email is kept, and finishes through the existing OAuth return. The start and continue forms stay shown with Continue busy while the redirect starts. If the browser is still on the page after the hold, the form is usable again. A failed start shows its reason on the form. Entries with no form to hold, such as an invitation or a code screen, show the loading screen and start the redirect when the enterprise route opens. Choosing between several connections is not built. That case shows FAPI's error.
…e SSO A sign-up can need a Protect check and enterprise SSO at once. The first test asserts that the check runs before the redirect to the identity provider and that the redirect starts once. The second asserts that a check raised on the return runs, and that solving it finishes the sign-up.
An email domain can belong to more than one enterprise connection. Clerk then refuses to start the redirect without a connection id, and sign-up showed that error. Sign-up now lists the connections and shows the chooser on the enterprise route. Picking a connection starts the redirect with its id, with that button busy and the others disabled. Back returns to the form with the email kept. The list comes from `__experimental_getEnterpriseConnections` on the legacy sign-up resource, because `SignUpFuture` has no method for it. A list that fails or comes back empty shows the reason on the form, or Start over when no form is behind it. Clerk only asks for a connection id when the instance allows several connections on one domain, so sign-up with one connection is unchanged.
…the enterprise connections Back on the enterprise connections screen returned to the form with the password still filled in, after it had already been sent. Edit on a verify screen clears it, and Back now does the same. The email address stays.
… raising timeouts The enterprise SSO and enterprise connections tests waited out the redirect hold in real time and raised their waitFor timeout to 4 seconds to fit it. They now run on fake timers and advance past the hold. Their seeded sign-ups no longer set missing_fields by hand. The fake FAPI derives enterprise_sso from the email domain.
…ion from the activity machine Starting enterprise SSO is the activity machine's startingEnterpriseSso state, entered on a visit that opens on the enterprise route or by START_ENTERPRISE_SSO from next, once per mount. The connections to choose from live in the machine's context, set by CHOOSE_CONNECTION and cleared by CANCEL_CONNECTIONS. This replaces the enterpriseSso pending-action key, the lastKey check, the connections state and the effect that started the redirect. A failed start still shows its error on Start over.
austincalvelage
force-pushed
the
austin/mosaic-sign-up-enterprise-sso
branch
from
December 2, 2026 07:33
74cce81 to
460dbeb
Compare
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.
Description
Adds enterprise SSO to Mosaic
<SignUp />, with one connection or several. Stacked on #10945.An email whose domain belongs to an enterprise connection used to end on Start over. Sign-up now sends the browser to the identity provider, as the legacy
SignUpdoes, and finishes through the OAuth return that #10945 added. When the domain has several connections, sign-up shows a chooser first.Shared changes (for Mosaic reviewers)
enterprise_ssoon the return.feature_not_enabled, and starts with a chosen connection id.handleRedirectCallbackexpects. It used to clear it. The social tests still pass.samlstrategy.docs/internals/sign-in-sign-up-flow.mddescribes both paths under "Entry actions".1. The redirect starts from the form's own submit, and the form holds while it does.
REDIRECT_HOLD_MS. The form is usable again, for example after Back from the provider. Pressing Continue starts the redirect again.sign-up-details.controller.tsstarts the redirect inside the form's own submit, then holds, the wayselectOAuthdoes for a social button.sign-up.routes.tsletscontinuestay shown while the step isenterprise_sso, so the continue form can hold.startalready stayed shown for every step.2. With no form to hold, the
enterpriseConnectionsroute starts the redirect.enterprise_ssostep. Those show the loading screen and start the redirect when theenterpriseConnectionsroute opens. Start over appears if the start fails or the browser is still on the page after the hold.sign-up.controller.tsstarts it from the existing entry-action effect when the shown route isenterpriseConnections, next to the ticket and OAuth-return entries.3. A domain with several connections gets a chooser.
enterprise_connection_id_is_required_with_multiple_connections, sign-up lists the connections and shows "Choose an account" on theenterpriseConnectionsroute, with the existingAuthEnterpriseConnectionsblock.sign-up.model.tsaddsflow.startEnterpriseSso(connectionId?). It callssso({ strategy: 'enterprise_sso' })with the callback URL the social flow uses, and does not reset the sign-up. On the several-connections error it lists the connections and resolves with{ type: 'enterprise_connections' }, the waycreateresolves withblocked.sign-up.controller.tskeeps that list for the mount and shows the chooser when it has one. No route rule changed for the chooser.FAPI asks for a connection id only when the instance flag
allow_multiple_enterprise_domainsis on. Without the flag, a domain has one connection and this path does not run.Known gaps
__experimental_getEnterpriseConnectionson the legacy sign-up resource.SignUpFuturehas no method to list connections. Adding one is a separate clerk-js change.continuewith the step alreadyenterprise_ssoshows the continue form, and the redirect starts when the user presses Continue.oidcPromptis not supported, because it would add a prop toSignUp.SignUpleaves on the user is not checked.Checklist
pnpm testruns as expected.pnpm buildruns as expected.Type of change
🤖 Generated with Claude Code