Why each tenant brings its own identity provider to Keycloak organizations
A B2B SaaS or shared-platform team often finds that its customers want to sign in with their own Microsoft Entra ID, Okta or SAML directory instead of a shared login. Keycloak organizations answer this need: each organization can have its own linked identity provider, and users are routed to it by their email domain. The Organizations feature, documented in the Keycloak server administration guide, lets you manage member organizations, their domains and the identity providers attached to them inside a single realm, so one customer's sign-in policy does not have to live in a separate deployment.
This matters most when tenants have their own corporate directories and security teams that expect control over authentication, such as MFA rules, session length or offboarding through their own IdP. It also matters when a customer's compliance review asks where sign-in decisions are made. A shared provider is usually enough when all users belong to one company, when your own directory or a single social or enterprise login covers every audience, or when tenants simply need access to the same application without their own authentication policy. In that case, organization membership and roles can carry the tenant context without a per-tenant identity provider.
Before you commit, confirm which identity providers your customers actually use, whether each one supports the protocol and attribute mappings you need, and who in your organization or the customer's will own the provider configuration after go-live. Ask whether any customer requires a dedicated realm or only a dedicated provider, since that choice changes administration, token size and upgrade effort. Verify the current organization and domain capabilities against the release you plan to run, because this area of Keycloak has changed across recent versions.
How a tenant user reaches the right identity provider
The flow starts when a user enters an email address on the Keycloak login page in the realm. Keycloak matches the email domain to a verified domain on an organization, then sends the user to that organization's linked identity provider through brokering. After the upstream provider authenticates the user, Keycloak issues its own tokens to the client application, which should check that the organization claim matches the tenant it expects. Confirm that each domain is verified and that the identity-first login setting is enabled for the organization before testing.
Identity-first login routes a user from email domain to the tenant's linked provider.
Dedicated, shared and domain-routed providers compared
A dedicated provider gives each organization its own identity provider configuration in Keycloak, pointing at that customer's Entra ID tenant, Okta org or SAML identity provider. The customer's directory team usually supplies the metadata and registers the Keycloak broker endpoint in its own environment, so trust, signing keys and claim mappings stay scoped to that tenant. The Keycloak server administration guide documents the brokering settings to review for each provider.
- Who configures it: Your administrators create the provider and link it to the organization, but the customer's directory administrator completes the upstream registration.
- Upstream registrations: Each tenant registers its own application in its directory, so the registration count grows with every customer.
- Isolation: Certificates, client secrets and mappers are separate per tenant, so a change for one customer cannot affect another.
- Leaving a tenant: Deleting the organization and its provider is a contained change in Keycloak, but the customer should remove the registration from its own directory, and you should review accounts that were linked to that provider.
- Ongoing effort: Rotations of secrets and certificates repeat for every tenant, so count them in your operating model.
Before committing to this model, confirm how your Keycloak version scopes provider settings to an organization and estimate the onboarding steps per tenant with your own automation.
A shared provider is configured once in Keycloak and used by several organizations. This is common when the customers all use the same upstream platform, such as one multi-tenant application registration in a single directory product. Your team holds the configuration, and customers do little or no Keycloak work, which shifts most of the effort to your side of the engagement.
- Who configures it: Your team configures one provider and links the organizations that should use it.
- Upstream registrations: One registration serves all tenants, which reduces customer-side work but ties every tenant's sign-in to that single application.
- Membership: Users arriving through the shared provider must be linked to the correct organization, either through invitation or through membership rules. Confirm which approach your version supports and how it behaves for users who appear in more than one organization.
- Leaving a tenant: Removing the organization's membership and mappers ends its access, but the shared provider stays in place for everyone else. Users can still authenticate through it unless their membership is removed.
- Blast radius: A change to the shared provider, such as a certificate rotation or a mapper edit, affects every linked tenant at once, so changes need a coordinated window.
Confirm the membership behavior and the tenant offboarding steps in a test realm before you promise either to a customer.
Domain routing keeps one shared provider but uses the user's email domain to choose where sign-in goes. With identity-first login, the user enters an email address, Keycloak matches the domain to an organization, and the browser is redirected to that organization's provider. The Organizations feature in the server administration guide describes managing member organizations and their domains, which is the basis for this design.
- Who configures it: Your team maintains the domain entries, and the customer confirms that it controls each domain as your verification process requires. Confirm the verification method your version offers.
- Upstream registrations: Customers need no Keycloak work, but domain entries must be unique across organizations, so overlapping or mistyped domains need a review step before go-live.
- Login experience: Users see an email-first prompt. Addresses on domains that are not mapped need a fallback path, such as a local login or an error message, and you should decide which one applies.
- Leaving a tenant: Remove the domains and the organization together. A domain left behind can keep routing sign-ins to a provider that no longer has an intended owner, so audit stale entries during offboarding.
- Edge cases: Personal mailboxes on a customer's domain, contractors with a different domain and subsidiaries sharing one domain each need a documented rule.
Test routing with a set of sample addresses for each tenant, including one unmapped domain, before enabling identity-first login for real users.
Configuration options and when each fits
This table compares the main configuration choices for linking each customer to its own identity provider in a Keycloak organization. Read each row for the fit and the trade-off, then check which options your Keycloak version exposes in its Organizations settings before you commit to a design.
| Configuration choice | When it fits | Trade-off to weigh |
|---|---|---|
| OIDC provider | Customer runs Entra ID, Okta or another OpenID Connect provider and can supply a client registration | Needs client ID, secret and redirect handling per tenant; secret rotation becomes a recurring task |
| SAML 2.0 provider | Customer's directory only offers SAML, or its security team requires it | Certificate and metadata renewals must be tracked per tenant; attribute mapping is usually more manual |
| Domain linking | Customer owns one or more email domains and wants users with those domains routed to its provider | Each domain must be verified and kept unique across organizations; domain changes need admin review |
| Identity-first login | Tenants have their own provider and users should type an email address before seeing a sign-in method | Users with unlinked or personal addresses need a fallback path; support staff must explain the first step |
| Provider chooser | Users belong to several organizations or use a mix of providers and local accounts | Login page shows more options and can confuse users who expect their employer's sign-in only |
| Shared provider across tenants | Several tenants trust the same corporate directory or a provider you operate for a group of business units | Changes affect every linked organization at once; isolation between tenants relies on membership and mappers |
| Dedicated provider per tenant | Each customer requires its own provider settings, claim rules and audit trail | Highest admin effort per onboarding and offboarding; more secrets and configurations to review and retire |
| Managed membership on first login | Onboarding should add a user to the organization when they first authenticate through the linked provider | Users who should not have access must be filtered at the provider or by a later review, since any domain match can join |
| Mapper and role sync | Application needs group, role or organization claims from the customer's directory on every sign-in | Stale roles persist until the next login unless the process is tested; mapper errors can grant or deny access silently |
How to link a customer's identity provider to an organization
This sequence connects one customer's Entra ID, Okta or SAML provider to a Keycloak organization so that the customer's users sign in through their own directory and join the organization automatically. Each step ends with a check that confirms the link works before the next step starts.
Enable the organizations feature in the realm
Confirm that the Organizations feature is available in the realm that will host your tenants, then turn it on in the realm settings or through the deployment's feature configuration, following the server administration guide for your Keycloak version. The administrator who makes this change should also record the Keycloak version and realm name in the change ticket, since the feature's behavior is tied to the release you run. Done means the Organizations menu appears in the admin console for that realm and an empty organization list loads without errors.
Create the organization and its settings
Create the organization for the customer with its name, alias and any attributes your application needs to read later. Decide at this point whether users can be members without an invitation and whether the organization will hold one identity provider or several, because these choices shape the later steps. Done means the organization appears in the list, and an administrator can open it and see the members and identity provider tabs.
Verify the customer's email domain
Add the domains the customer uses for sign-in to the organization, then prove ownership of each one through the verification method your Keycloak version offers, which typically means the customer publishes a record or confirms control of an address on the domain. Ask the customer to confirm the exact list of domains, including any subsidiary domains, before you start, because a missing domain sends those users to the wrong login path. Done means each domain shows as verified in the organization and a test address on that domain is recognized during sign-in.
Register Keycloak as an application in the customer's provider
Ask the customer's identity team to create an application registration in their Entra ID tenant, Okta org or SAML provider, and give them the Keycloak broker redirect URI and metadata your Keycloak version generates for the identity provider. Review the redirect URI character by character against the Keycloak host, realm and alias, because a single mismatch produces an error at the provider. For SAML, check the entity ID, assertion consumer URL and signing certificate on both sides. Done means the customer returns the client ID, the secret or certificate, and the metadata URL or XML, and you can see them listed in the provider's application.
Add the provider to the organization
In Keycloak, create the identity provider with the customer's values and attach it to the organization so that users from the verified domains are routed to it. Map the claims or SAML attributes you need, such as email and name, and decide which attribute drives matching for existing accounts. Done means the provider appears under the organization's identity providers tab, its status shows as enabled, and the discovery or metadata fetch completes without errors.
Configure identity-first login
Set the realm's login flow so that the user enters an email address first, and Keycloak uses the domain to select the organization's provider. Keep a local login path available for administrators and for any user outside the verified domains, and check how the login page behaves for a domain with no provider. Done means that an address on a verified domain goes straight to the customer's sign-in page, while an address on an unrelated domain shows the standard login options.
Test sign-in with a domain user
Sign in with a test account on the customer's verified domain, ideally one created by the customer for this purpose, and confirm that the browser reaches the customer's provider, returns to Keycloak without a redirect error, and lands in the application with the expected organization claim. Repeat the test with a user who has never signed in before to check first-login account creation and attribute mapping. Log the event and token contents for both tests. Done means both sign-ins succeed and the test user appears in the organization's member list.
Set managed membership and confirm removal
Turn on managed membership for the organization so that users who sign in from a verified domain are added automatically, and confirm with the customer what happens when a user leaves their company. Test removal by disabling the test account at the provider and checking how Keycloak handles the existing session and the membership record. Done means a new domain user joins the organization without an admin action, and the customer has signed off on the offboarding behavior you observed.
Where domain routing and brokering projects fail
The most common failure in per-tenant brokering is a domain that routes to the wrong place or to nowhere. Before any identity provider is linked, confirm that each domain is verified and owned by exactly one organization. An unverified domain cannot safely drive home-realm discovery, and two organizations claiming overlapping domains (for example, a parent company and a subsidiary that share a root) produce ambiguous routing that users experience as a login loop or an unexpected landing page. Check the domain list on every organization during setup, and check again when a customer adds a subdomain. Ask each customer to prove domain control before you record it, and document who approved that record.
The second group of failures sits in the trust configuration between Keycloak and the customer's directory. A redirect URI registered at the customer's Entra ID or Okta tenant must match the broker callback URL that your Keycloak realm generates for that identity provider alias, character for character, including the hostname and the path. SAML is stricter: the entity ID, ACS URL and signing certificate in the imported metadata must match what the customer's provider holds, and a rotated signing certificate silently breaks sign-in until the metadata is refreshed. Make metadata import and a test sign-in part of the sign-off checklist, and record the certificate expiry date so the rotation has an owner.
Two failures appear after go-live. The first is an email claim that does not match the customer's domain, for example a user whose address is a personal mailbox or an alias on another domain. Domain routing keys on the email, so these users fall back to the local login or fail to link. Confirm with each customer which claim carries the email and whether it is always a verified address. The second is a user who already exists locally with the same email. Decide in advance whether the brokered login links to that account or is blocked, and test that path with a pre-existing user before the customer's staff arrive. Finally, attribute mappers that read a claim such as a department or a group will break when the customer renames or restructures its directory, so review mappers after any directory change and add a test user who exercises each mapped attribute.
Security and operational controls for tenant identity providers
Once each tenant can sign in through its own identity provider, Keycloak becomes the trust broker between customer directories and your applications. The controls below cover transport, admin exposure, token validation, domain trust, secret handling and login visibility, and each one is a setting or process you can verify before onboarding the first tenant.
TLS on every connection
Keycloak's production guide calls for TLS on all communication, including traffic between the reverse proxy and Keycloak, and between Keycloak and each upstream identity provider's metadata and token endpoints. Confirm that every tenant's metadata URL and OIDC endpoints use HTTPS, that certificate validation is not disabled on any broker, and that certificate renewal for the proxy is owned and monitored. A plaintext hop in a brokered flow exposes tenant credentials.
Production guideSeparate admin and public hostnames
Expose the admin console and Administration REST API on a different hostname or context path from public frontend URLs, and restrict paths at the reverse proxy. Tenant onboarding automation calls the Admin REST API, so this surface needs its own network rules, access logging and credentials. Check that a tenant user cannot reach admin paths through the public login hostname, and that automation tokens are scoped to the onboarding task.
Production guideValidate backchannel logout tokens
The Keycloak 26.8 upgrade notes make signature validation of backchannel logout tokens from external providers mandatory. Before you rely on logout propagation for a tenant's Entra ID, Okta or SAML-linked provider, test that a logout token signed with the wrong key or altered claims is rejected, and that the expected issuer and audience are checked. Record the test result per provider so a provider change triggers a retest.
Upgrading guideTrusting unverified domains
Domain routing sends a user to a provider based on the email domain they type, so a domain claimed by one organization must not be accepted for another. Require verified domain ownership before a domain is linked to an organization, and review who can add domains through delegated administration. Without this control, a tenant could claim a domain it does not own and route another company's staff into its provider. Illustrative case: a trial tenant adds a partner's domain and captures their sign-ins.
Server admin guideClient secret storage and rotation
Each brokered identity provider uses a client secret or certificate that Keycloak holds to talk to the customer's directory. Store these values in a secrets manager rather than in exported realm files, restrict who can read them in the admin console, and plan rotation with the customer, since the provider side must change too. Ask each tenant who owns the secret at their identity provider, when it expires, and how the handover will be recorded.
Login failure logging
Login failures are persisted to the database by default in Keycloak 26.8, which gives you a record of failed sign-ins per tenant. Decide retention for that data, who can query it, and how it is separated by organization so one tenant's support team does not see another's failures. Pair it with metrics at /metrics on the management interface, enabled with --metrics-enabled=true, so spikes in failures from one provider surface quickly.
Metrics guideQuestions teams ask before linking tenant identity providers
What does it cost to link a tenant's identity provider to Keycloak?
The cost depends on the written scope, and DeployOpen does not publish a price list, so a quote follows from the scope agreed in writing before work starts. The main cost drivers are the number of identity providers, their protocols (OIDC or SAML), whether domain routing and identity-first login are in scope, how many tenants share a provider, and how much automation is needed for membership. Ask any quote to separate one-time setup work (configuring the first provider, the login flow and test sign-ins) from recurring work such as onboarding new tenants, upgrades and support, which may be handled under a retainer. Ask the provider to list the Keycloak version, the database and the hosting environment each assumption depends on.
How long does the first tenant take to link compared with later tenants?
The first tenant usually takes longest because it sets the pattern: the organization, the identity provider configuration, the domain claim, the login flow and the attribute and role mappings. Later tenants reuse that pattern, so the work shifts to confirming their domain, metadata or client registration and testing their sign-in. Duration depends on how quickly the customer's identity team responds, how many protocol details need checking, and whether shared providers are used. No duration is fixed here, so ask for a timeline in the written scope that names the customer dependencies for each step.
What does the customer need to provide before linking its identity provider?
The customer has to supply the facts that Keycloak cannot discover on its own. Typically this includes:
- The email domains that should route to its identity provider, and proof that it controls them
- Its provider's metadata or client registration details, such as the OIDC issuer and client credentials or the SAML metadata
- The attributes, group claims or roles it wants mapped into the application
- A named contact who can test sign-in and approve the change before it goes live
Ask the customer to confirm these items early, because missing domain proof or group claims are common reasons a link stalls.
Can an internal team link tenant identity providers without outside help?
Yes, if the team already runs Keycloak in production and has people who understand OIDC, SAML, realm and organization administration, and the security review process for federated sign-in. Many teams start by handling the first tenant with a partner so the pattern is documented, then take over onboarding of later tenants. The factors to weigh are the skills available, the number of tenants expected, how often provider configurations change, and who is accountable for a failed sign-in at 2 a.m. DeployOpen plans, implements and documents this work in the client's own infrastructure, and it can hand over the runbook so your team can continue.
How should a tenant's identity provider be offboarded?
Offboarding means removing the provider link without locking out users who should still have access, and it should be a planned change. The usual sequence is to confirm with the customer which users will move to another sign-in method, disable new sign-ins through the provider, remove the domain routing and provider link from the organization, review which accounts remain and how they are handled, and record the change in your audit trail. Ask whether the scope covers user cleanup, token and session revocation, and the documentation of the change. Check that removing a provider does not break other tenants that share it.
Does Keycloak issue a compliance certification for a tenant identity setup?
No. Keycloak is an open source project licensed under Apache 2.0, and the project does not issue audit reports, attestations or certifications for a deployment. DeployOpen prepares configuration, controls and evidence for compliance assessments, but it does not issue audit reports or certifications either. Independent auditors and certification bodies perform that assessment. Ask your auditor which evidence they expect for federated sign-in, such as provider configuration records, access reviews and logs of administrative changes, and plan to collect it during the build.
What security checks should happen before a tenant provider goes live?
Before go-live, confirm that the provider's signing certificates and metadata are validated, that domain routing sends only the intended addresses to that provider, and that a user from one tenant cannot sign in to another tenant's organization. Test sign-in, sign-out and logout behavior, and check the handling of backchannel logout tokens. Keycloak's 26.8 upgrade notes state that signature validation of backchannel logout tokens from external providers is mandatory, so verify that your configuration works with it. Confirm that TLS is enforced on every hop and that admin access is restricted to authorized staff.
Limits to confirm in your environment before you commit
The organization feature and per-tenant provider design depend on details that change by release, by upstream provider and by the customer's own rules. Confirm each item below against your target Keycloak version and your environment before you agree on scope.
Keycloak version and organization behavior
Organization features, including linked identity providers and domain routing, change between releases. Pin the exact version you plan to run, then test linking, domain-based identity-first login and managed membership on that version in a staging realm. The current release is 26.8.1, but a deployment built on an older minor line may behave differently. Ask whether any organization behavior you rely on is still opt-in or changed in your target release.
Keycloak docsSupported upstream provider configurations
Each customer may run Entra ID, Okta, or a SAML identity provider with different settings for signing keys, metadata, claim names, and group mapping. Build a test matrix from the providers your customers actually use, and record which attributes and claims each one sends. Do not assume that a configuration working for one customer will work for another. Confirm how each provider handles logout and token signature validation.
Organization and provider capacity
The number of organizations, linked identity providers, and members each database and cluster can carry depends on your load, your database, and your high availability design. Ask the vendor and your own test team for limits they have measured, and run a load test with your expected tenant count before you commit. Confirm that your database is one of the supported production databases and that the cluster design uses synchronous replication where the project requires it.
HA overviewToken size for multi-organization users
A user who belongs to many organizations can receive a large token if organization claims are included in every token. Large tokens can increase header size and slow requests through proxies and applications. Decide which organization data belongs in the token, which can be fetched on demand, and test the largest membership you expect. Confirm the header size limits of your reverse proxy and load balancers.
Customer policy on external identity providers
Some customers do not allow their staff to sign in through a provider the customer does not control, or they require a specific authentication method, session length, or logging standard. Ask each customer's security or procurement team which identity providers they accept, who owns the client registration in their tenant, and how they want access revoked. Record the answers in the onboarding checklist, because they decide whether a per-tenant provider is allowed at all.
What DeployOpen needs from you to scope this work
A written scope starts with the tenant list: every customer or business unit that will sign in through its own identity provider, the email domains each one uses, and whether any tenant needs more than one domain or a shared provider with another tenant. Include the identity provider type for each tenant (Microsoft Entra ID, Okta, or a generic SAML 2.0 or OIDC provider), the metadata or discovery details your team can export, and the admin contact who can approve the trust relationship and confirm group or role mappings. Ask each contact to confirm which users must be auto-enrolled into the organization and which should be invited, because that choice decides how membership is managed later. Also tell us whether any tenant has existing Keycloak users that must be linked to the new provider, since account linking changes the migration work.
Next, list the applications that will trust the tokens issued for these organizations, with their protocol (OIDC or SAML), redirect URIs, and whether they read an organization claim. Describe the target Keycloak deployment as well: the version you run or plan to run, the database engine and its high availability design, the public hostname and reverse proxy in front of it, and where the admin console will be reachable. Confirm whether Keycloak will be deployed on Kubernetes with the Operator or on virtual machines, because that determines how client and provider configuration is managed. Confirm too who will own the Keycloak admin role after handover.
Finally, agree the acceptance tests before work starts. For each tenant, define the sign-in path to test (domain entry, identity-first login, and direct link), the expected result for a user from an unlisted domain, the expected behavior when a tenant's identity provider is disabled, and the offboarding check that removes access. Ask your security team which logs and evidence they need to review for each tenant. Confirm with your identity provider administrators the test accounts and any conditional access policies that will apply to Keycloak sign-ins, since these can block tests if they are not planned. These inputs together let DeployOpen price and schedule the work as a fixed-scope engagement, with the scope, deliverables, and timeline set in writing before work starts.
How DeployOpen scopes, delivers and supports tenant identity provider work
DeployOpen plans, implements, tests, documents and supports self-hosted Keycloak inside your own infrastructure, including the organizations, identity provider links and domain routing that let each business customer sign in with its own identity provider. Engagements are agreed as fixed-scope work with written deliverables before any build starts.
How we scope
- Inventory the tenants, their identity providers and the protocols each one uses, such as OIDC or SAML.
- Define which organizations, verified domains and identity-first login rules the written scope covers.
- Agree in writing which tenant admins, managed membership rules and audit evidence are in and out of scope.
How we build
- Configure organizations, linked identity providers, domain routing and shared provider settings in a non-production realm first.
- Test sign-in, first login, managed membership and sign-out for each tenant type with representative test accounts.
- Document the configuration as code where your team wants it, so each new tenant follows the same reviewed path.
How we hand over
- Deliver written configuration records, runbooks for onboarding and offboarding a tenant, and a list of open decisions.
- Train your administrators on verifying a domain, rotating an upstream client secret and checking a broken login.
- Provide test results and retest notes so your security and compliance teams can review the setup independently.
How we support
- Offer ongoing support, upgrades and continuous testing as a retainer after handover, scoped in writing.
- Plan Keycloak upgrades and review release notes for changes that affect identity provider linking or login flows.
- Retest tenant sign-in paths after material changes to identity providers, domains or Keycloak versions.

