Skip to content
BuildBase

Set up Enterprise SSO through your WorkOS account

Let a company you sell to sign its people in with its own identity provider, SAML or OIDC, through your own WorkOS account, step by step.

Enterprise single sign-on lets the people of a company you sell to sign in to your app with their company account: Okta, Microsoft Entra ID, Google Workspace, or any SAML or OIDC identity provider. Your login page shows Continue with SSO, they type their work email, and their company's identity provider does the rest. It runs through your own WorkOS account: BuildBase keeps your WorkOS client ID and an encrypted API key, makes one WorkOS organization per company, and runs the sign-in itself. WorkOS bills your account for each connection; see WorkOS pricing for its current rates. This guide is the setup in order; Enterprise SSO is the full reference.

Before you start

  • A WorkOS account, with its staging environment for testing and production for real companies.
  • An auth client with a login page, and an owner or admin role in the BuildBase console.
  • A plan that includes Enterprise SSO.

What goes where

Copy thisFromPaste it into
Client IDWorkOS, the environment's API Keys pageBuildBase, Authentication, Enterprise
API keyWorkOS, the same page (create one)BuildBase, the same tab
Redirect URIBuildBase, the Enterprise tab once the key is savedWorkOS, the application's Redirects, as the default
The company's domainThe companyBuildBase, the enterprise's Email domains; WorkOS verifies it

1. Open the Enterprise tab

Open the Enterprise tab in the console

(opens the console in a new tab)

In the rail choose Users, then Authentication under Access, and the Enterprise tab.

Authentication with the Enterprise tab highlighted as step 1, and the Enterprise single sign-on card with its four steps, Client ID, API key and Save and validate

2. Connect your WorkOS account

In WorkOS, on the environment's API Keys page, copy the client ID (client_...) and create an API key (sk_...), both from the same environment. Paste them into Client ID and API key on the Enterprise single sign-on card, and press Save and validate. BuildBase checks the key with WorkOS before it stores anything.

Enterprise single sign-on with an example client ID and the API key filled in, and Save and validate highlighted as step 2

3. Register the redirect URI in WorkOS

The card becomes WorkOS provider: your client ID, a preview of the key, the Redirect URI and when the key was last checked. Copy the redirect URI into WorkOS, under the application's Redirects, and make it the default. Leave AuthKit off in that environment: BuildBase uses WorkOS for single sign-on only. Check the key checks it again at any time.

The WorkOS provider card: example client ID and key preview, the Redirect URI with its copy button highlighted as step 3, Last check Working, and Check the key

4. Add the company

Press Add enterprise. In Add an enterprise, type the Company name, keep Create accounts on first sign-in on unless the company's people must already have an account, and press Add enterprise. BuildBase makes the company's organization in your WorkOS account.

Add an enterprise with Company name Northwind highlighted as step 4, Create accounts on first sign-in on, and Add enterprise

5. Add its email domain

The company's page opens. Under Email domains, type the company's domain and press Add domain. It reads Pending until the company's IT admin publishes the DNS record WorkOS shows them; then Refresh from WorkOS reads it as Verified. Only a domain WorkOS verified sends anyone to the company's sign-in.

Email domains with northwind.example Pending, highlighted as step 5, Verify and Remove, and Verify in WorkOS and Refresh from WorkOS

Once the record is published and WorkOS has checked it:

Email domains with northwind.example Verified, highlighted as step 5, beside Check again and Remove

6. Hand the connection to the company's IT admin

Under Connect the identity provider, type the IT admin's address in Invite the IT admin by email, tick Domain verification so the same email covers the domain, and press Send invitation. Or Open the setup portal now on a call together. They connect their identity provider in WorkOS's setup portal and never need a BuildBase account; send them the page for IT admins. Identity providers on the same page shows the connection once it is active.

Connect the identity provider: Invite the IT admin by email with it-admin@northwind.example, Single sign-on and Domain verification ticked, Send invitation highlighted as step 6, and Open the setup portal now

Once they have finished in the portal, Identity providers lists the connection as Active (press Refresh to read it from WorkOS again):

Identity providers: Okta, Active and Default, OktaSAML named Northwind in WorkOS, signing in northwind.example, with its example connection ID

7. Turn sign-in on

Back on the Enterprise tab, turn Sign-in on in the WorkOS provider card.

The WorkOS provider card reading On, with the Sign-in switch highlighted as step 7

8. Add the Enterprise SSO method

On the Methods tab press Add auth method, choose Enterprise SSO, keep or change its Title, and press Create. Then attach it to each auth client whose login page should offer it: on the Settings tab, Edit on the client, tick the method under Methods, and Update.

Add new method with Enterprise SSO highlighted, what it is for and what else it needs, and the Title Single sign-on

9. Choose the company's workspaces

On the company's page, under Workspaces, pick a workspace, Add workspace, and press Save workspaces. Its people join those workspaces the first time they sign in through the company (step 6 of the reference).

Workspaces with Choose a workspace, Add workspace and Save workspaces highlighted as step 9

10. Sign in

Your login page now offers single sign-on. Beside your other ways in, its button reads Single sign-on (screen readers hear "Continue with SSO").

The hosted sign-in page: Email and Continue, and below them the Single sign-on button highlighted as step 10

Pressing it asks for a Work email. The person types theirs and presses Continue with SSO; their company's identity provider does the rest. Where single sign-on is the page's only way in, the Work email box shows straight away, with no button to press first.

After Single sign-on: the Work email field with dana@northwind.example highlighted as step 11, above Continue with SSO

Check that it worked

Sign in with a test user from your WorkOS staging environment's identity provider. The person appears in the company's People, lands in the workspaces you chose, and Activity shows the sign-in.

People: Dana Reyes, dana@northwind.example, signed in by single sign-on, with Sessions and Sign out, and WorkOS roles: admin, from single sign-on

Things to watch out for

  • Turn Sign-in on before adding the method. While enterprise sign-in is off, adding an Enterprise SSO method is refused with 409 enterprise_not_enabled: "Configure WorkOS and turn enterprise sign-in on, on the Enterprise tab, before adding the method."
  • Keep the client ID and the key from one environment. A staging key with a production client ID passes every check until the first sign-in, which then fails.
  • Require single sign-on only once the connection is active. With it on, the company's people are refused at every other way in (a password, a code, a passkey, a wallet, a social button, the second step of two-step), and until the connection works they cannot sign in at all. Its access policy can instead narrow the other ways, down to passkeys only.
  • A domain counts only while WorkOS verifies it. A pending domain routes nobody, and a subdomain is its own entry: the email the identity provider sends must be on a verified domain of that company, exactly.
  • Attach the method to every client the company's people use. A login page without single sign-on leaves them a sentence that points at a button the page does not have.
  • A sign-in screen of your own sends a PKCE challenge. PKCE is a check that the sign-in finishes in the same browser that started it, and the hosted page does it for you. Continue with SSO sends an S256 challenge, and the start refuses a request without one. So the code the identity provider sends back works only in the browser that pressed the button. If you build your own screen against the start, it must make a verifier, send its challenge and redeem the code with it (how).

Next steps