Repository navigation
feat(mosaic): sign up with enterprise SSO - #11022
Draft
austincalvelage wants to merge 4 commits into
Draft
austincalvelage wants to merge 4 commits into
austincalvelage wants to merge 4 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: 8d34792 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: |
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.
austincalvelage
force-pushed
the
austin/mosaic-sign-up-enterprise-sso
branch
from
November 26, 2026 08:07
40f72ce to
8d34792
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.What the user sees
REDIRECT_HOLD_MS. The form is usable again, for example after Back from the provider. Pressing Continue starts the redirect again.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.With several connections on the domain
enterprise_connection_id_is_required_with_multiple_connections, sign-up lists the connections and shows "Choose an account" on theenterpriseConnectionsroute, with the existingAuthEnterpriseConnectionsblock.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.How it works
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.sign-up-details.controller.tsstarts the redirect inside the form's own submit, then holds, the wayselectOAuthdoes for a social button.sign-up.controller.tsstarts it from the existing entry-action effect when the shown route isenterpriseConnections, next to the ticket and OAuth-return entries.sign-up.routes.tsletscontinuestay shown while the step isenterprise_sso, so the continue form can hold.startalready stayed shown for every step.docs/internals/sign-in-sign-up-flow.mddescribes both paths under "Entry actions".Fake FAPI
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.Tested in a browser
Run in Chrome against a staging development instance with one active SAML connection. A local Keycloak was the identity provider, from the same image that the SSO integration tests use.
Email and password on the start form. The form stays shown with the fields locked and Continue busy. The same tab goes to the identity provider. The return ends signed in as the new user, with a SAML enterprise account.
The same email a second time. The return signs in to the account that already exists. The instance still has one user for that email.
Continue with Google, with a Google account on the connection's domain. After Google, FAPI still requires SSO. Sign-up goes on to the identity provider, and the return ends signed in. No Google account is linked to the user.
Two connections on one domain. With
allow_multiple_enterprise_domainson for the instance, Continue shows the chooser with both connections. Back returns to the form with the email kept. Picking the second connection goes to its identity provider, and the return ends signed in with an enterprise account on that connection.Not run in a browser: Back from the identity provider, a redirect that fails to start, a connection list that fails, and the continue form. The feature tests cover those.
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