Keycloak for SaaS and technology companies

A SaaS team with enterprise customers needs per-tenant sign-in, onboarding and audit evidence. This page covers how Keycloak handles those jobs, what the build involves and what self-hosting identity costs in people and operations.

On this page

Keycloak for SaaS and technology companies: where it fits your product

Keycloak fits a SaaS product when enterprise customers expect their own identity provider, single sign-on and SOC 2 evidence, and your team is ready to run an identity service as a critical system. Keycloak is an open source identity and access management server under the Apache 2.0 license. It supports OpenID Connect, OAuth 2.0 and SAML 2.0, so it can sign in your application's users, accept sign-in from a customer's own identity provider through identity brokering, and federate existing directories through user federation. Its Organizations feature manages member organizations and their domains, which maps well to B2B tenants. The engineering work is less about turning these features on and more about tenant design, onboarding flows, delegated administration and the evidence your auditors will ask for.

Customer identity and workforce identity are often separate decisions, and it helps to make them separately. Customer identity covers the people who sign in to your product, often through per-tenant identity providers that differ for every enterprise account. Workforce identity covers your own staff who administer the platform, deploy it and read its logs. Keycloak can serve both, but the two populations have different lifecycles, MFA rules and admin boundaries, so many teams put the admin console and Administration REST API on a separate hostname or context path from public frontend URLs, as the production guide advises. Decide early whether one Keycloak serves both groups or whether workforce access runs on a separate instance.

Which SaaS identity requirements shape the Keycloak build

This table maps the regulatory and customer requirements a SaaS provider meets most often to the Keycloak design decisions they drive. Read each row as a question to answer before the build starts, not as a finished compliance position. The main takeaway is that identity design choices feed directly into the evidence you will later show customers, auditors and regulators.

RequirementSourceWhat it means for the build
B2B tenant sign-in through customer identity providersCustomer contracts and enterprise security reviewsPlan one identity provider per customer tenant, with brokering settings, claim mapping and a clear owner for each customer's configuration and removal.
Logical access and change management controlsSOC 2 common criteria CC6 to CC8 under the 2017 Trust Services CriteriaKeep realm and client configuration under version control, restrict admin console access, and retain records of who changed authentication settings and when.
Processor obligations for customer personal dataGDPR Article 28(3) and Article 32Document processing instructions for any identity data you hold on customers' users, and show the security measures applied to login data, sessions and tokens.
Switching rights for data processing servicesEU Data Act, Regulation (EU) 2023/2854, Articles 23 and 25Design user data exports and realm configuration exports so customers can move to another provider or on-premises infrastructure within the notice and transition periods.
Supply chain expectations for cloud and managed service providersNIS2, Directive (EU) 2022/2555, Annex I, and Implementing Regulation (EU) 2024/2690If you sell managed identity to customers or run their identity service, expect questions on your own dependencies, patching, backups and incident handling for the Keycloak stack.
Evidence that a control operated over a periodSOC 2 Type 2 examination under AT-C section 205Confirm which logs, access reviews and configuration histories you will retain across the examination period, since a Type 1 report only covers design as of a date.
Sign-in and admin surface hardeningCustomer security questionnaires and SOC 2 common criteria CC6Expose the admin console and Administration REST API on a different hostname from public login pages, and confirm TLS and reverse proxy path restrictions are in place.

How to model tenants: realms, organizations or one shared realm

In this model, each customer gets its own Keycloak realm with its own users, clients, roles, login theme and identity provider settings. Isolation is the strongest of the three options because a misconfigured setting in one realm does not change another realm's users or policies. The cost is administration: every realm carries its own configuration that must be created, kept consistent and audited, which usually needs automation rather than manual console work.

  • Isolation: Users, sessions, signing keys and client secrets are separated by realm, which simplifies customer-specific audit evidence.
  • Administration effort: Onboarding and every shared policy change must be repeated per realm unless provisioning is automated.
  • Branding: Each realm can carry its own login and email theme without custom template logic.
  • Per-tenant identity providers: Each customer's SAML or OIDC identity provider is configured inside its own realm, so a broken connection affects only that tenant.
  • Upgrade impact: Every realm must be checked during a Keycloak upgrade, and the number of realms multiplies testing time.

Before committing, confirm the expected number of tenants, how fast they will be onboarded, and whether any customer contract requires dedicated identity infrastructure.

Which Keycloak modules and settings a SaaS product needs first

A SaaS product that serves other businesses needs a small set of Keycloak settings in place before the first tenant signs in. The cards below cover the modules that model tenants, connect customer identity providers, protect product APIs, support customer users, automate onboarding and show tenant-level health. Decide these early, because changing tenant or client models later is far more expensive than configuring them well at the start.

Organizations and domain routing

The Organizations feature manages member organizations and their domains, which is the natural model for one B2B customer account. Map each customer to an organization, attach its verified email domains, and decide whether a user who signs in from a claimed domain is routed to that customer's identity provider. Check how the design handles a customer that owns several domains, a domain that moves between customers and a user who belongs to two organizations, because these cases are hard to unwind once users exist.

Server admin guide

Identity brokering to customer providers

Each enterprise customer often wants users to sign in with its own OIDC or SAML identity provider. Keycloak brokers those providers, so your product still receives one token format regardless of the upstream source. Decide which attributes and group claims are mapped into your user model, how first-login account linking works, and whether a customer can disable local password sign-in for its users. Test a deprovisioned user from the customer side, since brokered sessions can outlive the upstream account unless you set session and token lifetimes deliberately.

Identity brokering docs

Token and client configuration for product APIs

Each product API should have its own audience, scopes and client definitions so a token issued for the web app cannot be replayed against another service. Define one client per application type, set access token lifetimes shorter than session lifetimes, and map tenant identifiers into tokens as claims that your API checks on every request. Ask your team which claims the APIs trust for tenant isolation, because a missing or spoofable tenant claim is a cross-tenant data exposure risk that no later configuration can fully repair.

Passkeys and OTP policies for customer users

Customer users sign in with a wide range of devices and skill levels, so authentication policy has to be set per realm or per organization. Keycloak supports OTP policies, W3C WebAuthn and passkeys with conditional and modal UI, and recovery codes. Decide which factors you offer by default, which customers may require stronger factors, and how a locked-out administrator at a customer recovers access without your support team holding their credentials. Confirm how each factor interacts with the brokered sign-in path, because a customer's upstream provider may already enforce its own MFA.

Administration API on a separate hostname

Automated onboarding calls the Administration REST API to create organizations, providers and users, so it is a high-value target. Keycloak's production guidance says to expose the admin console and Administration REST API on a different hostname or context path from public frontend URLs. Place it behind a reverse proxy with path restrictions, restrict it to your provisioning network, and give the onboarding service a dedicated client with narrow roles. Confirm that your self-service signup flow never reaches the admin hostname.

Production configuration

Metrics at /metrics for tenant operations

Keycloak exposes Prometheus-format metrics at /metrics on its management interface when started with --metrics-enabled=true, and optional HTTP request and cache histograms are available. Use them to watch sign-in latency, error rates and cache behavior by realm, and build alerts that page the team before one customer's onboarding wave degrades sign-in for all tenants. Confirm that the management port is not reachable from the public internet, and check whether your metrics platform can carry the label cardinality your tenant count produces.

Metrics configuration

Rollout phases for a SaaS identity migration

This sequence moves a SaaS product from its current sign-in setup to a self-managed Keycloak layer one tenant group at a time, so each stage proves the design before more customers depend on it. Each phase ends with a check that the next phase can rely on.

  1. Scope the tenant model and inventory customer identity providers

    Your product owner and identity lead define how customers map to realms, organizations and roles, and list every customer identity provider, protocol (OIDC or SAML), directory type and claim the product depends on. Engineering confirms which applications and APIs will send users to Keycloak and which must keep their current sign-in during the transition. The step is done when the inventory is signed off, each tenant has a documented owner and each protocol has a named test case.

  2. Build the reference environment with HA and a supported database

    Your platform team deploys a non-production reference environment that matches the intended production design: a supported production database (not the development file database), TLS on all communication, a reverse proxy with path restrictions, and the admin console and Administration REST API on a separate hostname or context path from public frontend URLs. Confirm the high availability architecture you will use, noting that both supported multi-site designs need a synchronously replicated database, and confirm the current Keycloak release and the Operator installation method you will standardize on. The step is done when failover and database recovery have been exercised and the environment is documented as code.

  3. Pilot one enterprise tenant through identity brokering

    Choose one willing enterprise customer with a well-understood identity provider and connect it to Keycloak as a brokered identity provider with attribute and group mapping. Test sign-in, first-login account linking, role assignment, logout and token lifetimes against the product's real applications. Include the 26.8 upgrade notes in this pilot: confirm SMTP delivery uses StartTLS without plaintext fallback for password reset and invitation mail, and confirm that backchannel logout tokens from external providers are validated, because signature validation is mandatory. The step is done when the customer's administrators sign off on the sign-in flow and the test evidence is saved.

  4. Automate tenant onboarding through the admin API

    Your engineers replace manual setup with scripts or infrastructure-as-code that call the Administration REST API to create organizations, domains, identity providers, clients and role mappings for each new tenant. Keep the pilot tenant's configuration as the reference template and add a review step so a tenant administrator approves each identity provider change. Run the scripts against the reference environment first, then confirm that a repeat run produces the same result and that every change is logged. The step is done when a new test tenant can be onboarded end to end without manual console edits.

  5. Cut over customers in waves with rollback criteria

    Move customers in groups, starting with those whose identity providers match the pilot, and keep the existing sign-in path available until each group has been stable. Define before each wave the metrics you will watch, such as failed logins, token errors and support tickets, and the condition that triggers a rollback. Communicate each customer's switch date and the steps their users need to take, including any passkey or MFA re-enrollment. The step is done when every wave has passed its check and the legacy sign-in path is retired on a documented date.

  6. Run operations with a planned upgrade cadence

    Your operations team takes ownership of monitoring, backups, admin access and incident runbooks, using the Prometheus metrics endpoint enabled on the management interface and the health checks in the operations guides. Keycloak ships four minor releases a year, and breaking changes in a minor release are opt-in, so schedule upgrades in a staging environment that mirrors production and run the pilot tests again before each rollout. Set the Operator update approval mode to manual so no upgrade starts without review. The step is done when the first scheduled upgrade has passed staging, the runbook is current and on-call staff have practiced a recovery.

What SOC 2 evidence Keycloak can support, and what it cannot

Keycloak does not make a SOC 2 report possible on its own, but its configuration, logs and change records can supply much of the evidence an auditor tests. A SOC 2 examination is built on the AICPA 2017 Trust Services Criteria, which group controls into five categories: security, availability, processing integrity, confidentiality and privacy. The security common criteria, CC1 to CC9, apply to every SOC 2 report. Most of the Keycloak-related evidence falls under the logical access criteria in CC6 and the change management criteria in CC8. A Type 1 report describes whether controls were suitably designed as of a specific date. A Type 2 report adds an opinion on whether those controls operated effectively over a period, so the evidence has to exist continuously, not just on the day of the audit.

For a SaaS company, the useful evidence comes from four places. First, the realm and client configuration itself: MFA and password policies, token lifetimes, redirect URI rules and the settings that control which identity providers a tenant can use, exported and kept under version control so each change has a reviewable history. Second, admin access reviews: a dated export of who holds realm administrator or organization administrator roles, reviewed and signed off by someone other than the administrator. Third, Keycloak event and admin event logs, forwarded to a central store with retention that matches the audit period. Fourth, change control: infrastructure and realm configuration changes approved through the same pull request and deployment pipeline as application code. Keycloak cannot decide on its own whether these records are complete or whether the review was meaningful.

DeployOpen prepares these systems, controls and evidence for an assessment. It does not issue SOC 2 reports, attestations or opinions. Your independent CPA firm performs the examination and decides which evidence is sufficient, and management provides the written representations that the examination standard requires. Before scoping work, confirm with your auditor which Trust Services categories are in scope, the audit period, how Type 1 and Type 2 timing will work with your release cycle, and what log retention they expect. Also confirm that the platform, database and hosting provider are covered by your own subservice organization documentation, since Keycloak is only one part of the system described in the report.

Compliance considerations for SaaS identity

For a SaaS product, the identity layer is often the first control an auditor or customer security team examines. The cards below cover the frameworks most SaaS and technology buyers face, what each one asks of the sign-in system, and what to confirm with your auditor or counsel before you design around it.

SOC 2 logical access mapping

SOC 2 examinations apply the common criteria CC1 to CC9 to every report, and the logical access and system operations criteria in CC6 and CC7 are where Keycloak configuration is usually tested. Map each access criterion to a concrete setting: required MFA for staff and admin roles, realm and client ownership, admin console access, and session lifetimes. Keep exports of these settings and the admin event log, since a Type 2 report depends on controls operating across the observation period. Ask your auditor which points of focus they expect you to evidence.

Trust Services Criteria

ISO/IEC 27001:2022 technological controls

ISO/IEC 27001:2022 Annex A lists 34 technological controls, and several cover authentication, privileged access and access restriction. Treat ISO certification as an optional track: it is issued by an accredited certification body, not by the platform vendor or by DeployOpen, and it renews on a three-year cycle with at least one audit every calendar year. Decide early whether the identity design should be scoped for ISO so that evidence collection, such as administrator access reviews and key rotation records, starts before the first audit.

Certification cycle
Three-year
ISO certification guidance

NIS2 and Implementing Regulation 2024/2690

NIS2 places cloud computing providers and managed service providers in its high-criticality sectors, and Commission Implementing Regulation (EU) 2024/2690 sets the technical requirements for the security measures those providers must take. If your SaaS falls in these categories, or sells to customers who must flow requirements down to you, identity becomes an audited control: access management, MFA, privileged account handling and incident logging. Confirm with counsel whether your service is in scope before you write requirements into the identity design.

Implementing Regulation text

Cyber Resilience Act reporting duties

The Cyber Resilience Act covers software products with digital elements, and its Article 14 reporting obligations have applied since 11 September 2026 to in-scope products whenever they are placed on the market. For a product that ships Keycloak-based sign-in, or a self-hosted build that customers run, you need a way to receive vulnerability reports, track affected versions and notify the relevant authorities on time. Plan the Keycloak upgrade cadence and advisory monitoring as part of that process, and confirm with counsel which products and roles your company holds under the regulation.

Article 14 reporting start
11 Sept 2026
Regulation 2024/2847 text

GDPR processor contract terms

When your SaaS hosts customer identities, you are usually a processor, and GDPR Article 28(3) requires the processor contract to bind you to process personal data only on documented instructions, including for transfers, and to meet the security requirements of Article 32. Identity data such as usernames, email addresses, group memberships and login logs falls within that scope. Check that your data processing agreement names where Keycloak runs, which subprocessors touch identity stores or backups, and how login event retention is set.

GDPR text

Data Act switching for identity services

The EU Data Act has applied since 12 September 2025 and requires data processing service providers to let customers switch to another provider or to on-premises infrastructure, with a maximum two-month notice period and a 30-day transitional period. A hosted identity service built on Keycloak can fall under these duties. Design user, client and credential exports so a customer can move to a self-hosted Keycloak, and note that switching charges must be removed from 12 January 2027 under Article 29.

Switching charges end
12 Jan 2027
Data Act text

How Keycloak sits between customer identity providers and your product

The flow starts in two places: customer users who sign in through their corporate identity provider over OIDC or SAML, and direct users who sign in on the Keycloak login page. Keycloak brokers both paths into one realm or organization, then hands tokens to your product through its public frontend URL. The admin console and Administration REST API sit behind a reverse proxy on a separate hostname or path, and the database must be synchronously replicated. Check that metrics and logs leave the cluster for your operations stack.

Customer and direct sign-in paths converge on Keycloak before reaching the product.

What self-hosting identity costs compared with buying it

Self-hosting Keycloak removes the per-user license line but adds costs that a vendor-hosted identity service would otherwise carry. The upstream project is licensed under Apache 2.0, so the software itself has no license fee. The Red Hat build of Keycloak is a separate, subscription-based distribution, and the subscription is a real cost to put in the comparison if you want a vendor-supported build. Beyond licensing, the costs fall into four groups: infrastructure and database, engineering time for tenant automation, upgrades and on-call, and audit evidence. Ask any partner to quote each group separately so you can see which parts are one-time and which recur. Infrastructure includes the clustered Keycloak nodes, a database that the supported high availability designs require to be synchronously replicated, load balancing, TLS, monitoring and backups. Those run every month for as long as the service exists.

Most of the one-time cost is the build: realm and organization design, per-tenant identity provider onboarding, self-service flows, and the automation that creates customer configuration without manual admin work. Recurring cost is driven by four factors. Tenant count and how often tenants are created or changed set the size of the automation and the support load. Customer identity provider variety (for example, different SAML and OIDC setups per customer) multiplies testing and troubleshooting. The availability target sets how much redundancy, on-call coverage and disaster recovery testing you pay for. Upgrade cadence matters too, because the project ships minor releases several times a year and the 26.8 upgrade notes contain changes that need testing before rollout. Ask vendors to quote the build and the run separately, to state assumptions for tenant volume and identity provider count, and to say who carries on-call and security testing. Also ask what evidence they will prepare for your SOC 2 examination, since those controls are recurring work.

Questions SaaS teams ask before self-hosting Keycloak

What does a self-hosted Keycloak implementation cost, and what drives the price?

Keycloak itself is free to use under the Apache 2.0 license, so the cost is the work and the infrastructure around it. Expect one-time costs for design, build, customer identity provider onboarding, testing and handover, and recurring costs for hosting, database operations, monitoring, patching and upgrades. The main drivers are the number of tenants and identity providers, how much customization your login flows need, the high availability design, and how many systems must integrate. Ask any partner for a quote built from a written scope that lists each of these items separately, so you can see who is paid for what and which costs repeat each year.

How long does a Keycloak build take for a SaaS product?

The duration depends on scope rather than on Keycloak's installation time, which is usually the shortest step. The longest items are usually realm and organization design, the first few customer identity provider connections, login theme work, and proving the high availability and backup design works in your environment. Each additional tenant onboarding pattern, custom SPI extension or downstream application adds planning and test time. Keycloak ships four minor releases a year, so plan for an upgrade cycle that starts soon after go-live. Ask for a timeline tied to named milestones and acceptance tests rather than a single end date.

What does the work need from our internal engineering team?

Your team owns decisions that depend on your product: tenant model, how customers map to organizations and realms, which claims your APIs expect, and the roles your administrators need. Engineers also need to change application code to use OpenID Connect or SAML correctly, and someone must approve the production design. A partner can carry the build, documentation and runbooks, but the people who will operate Keycloak should take part in the build so they can run it after handover. Confirm in the scope who makes each decision, who reviews changes, and how many hours of engineer time the plan assumes on your side.

Can a small platform team run a self-hosted Keycloak?

A small team can run it if the design is simple and the operating tasks are written down. Day-two work includes watching metrics, managing the database and its backups, applying patches, testing upgrades in a staging environment, handling customer identity provider changes and supporting admins during incidents. Keycloak's Operator supports manual approval for updates, which helps a small team control when changes land. Upgrades matter most: the project reviews upgrade notes for each release, and the 26.8 notes include changes such as enforced SMTP StartTLS and mandatory signature validation for backchannel logout tokens from external providers. Decide in advance whether your team has time for this cadence or whether a retainer for upgrades and support fits better.

How is customer identity provider onboarding automated?

Keycloak can broker sign-in to customer identity providers over OIDC and SAML, and its Organizations feature manages member organizations and their domains. Automation is usually built around the Keycloak Admin REST API or the Operator's custom resources, driven by your own onboarding workflow, so each new customer gets an organization, a domain, an identity provider link and attribute or role mappings without manual console work. Design the flow for validation, failed connections, certificate or metadata rotation, and removal of a tenant. Confirm with your partner which steps are automated, how the workflow is tested, and who can see the audit trail of each change.

Does Keycloak alone produce SOC 2 evidence?

No. Keycloak can support SOC 2 controls for logical access, but a SOC 2 examination covers your whole system and the controls around it, and only a CPA firm issues the report. The security common criteria CC1 to CC9 apply to every SOC 2, and the access, change management and monitoring criteria in that set depend on how you configure and operate identity. Keycloak can provide configuration records, admin event logs, login failure records and metrics, while your processes provide access reviews, change approvals and incident handling. Ask your auditor which Type 1 or Type 2 scope fits your customers, and which evidence they will sample from Keycloak.

What to ask a partner before hiring for Keycloak identity

Start with tenant isolation, because it decides how much of the design a partner must get right on day one. Ask how each customer maps to a realm or to an organization inside a shared realm, who can see and change that tenant's clients, identity providers and user attributes, and how delegated administrators are kept inside their own boundary. Ask the partner to show the realm and role model on paper, including the admin role boundaries that stop one customer's administrator from reaching another customer's configuration. Then ask how the Organizations feature handles member domains, and what happens when a domain is claimed by two tenants.

Next, ask how customer identity provider brokering is tested before a tenant goes live. A credible answer names the test matrix: an OIDC and a SAML upstream per tenant, attribute and group mapping, first-broker-login behavior, logout and token lifetimes, and a negative test for a wrong issuer or an unsigned assertion. Ask whether the partner checks that backchannel logout tokens from external providers are signature validated, since the Keycloak 26.8 upgrade notes make that mandatory. Ask for the onboarding runbook a support engineer would follow for a customer's IdP, and who reviews it.

For upgrades, ask how the partner keeps unplanned changes out of production. Ask whether operator updates run in manual approval mode, as the Keycloak Operator documentation strongly recommends, and whether schema migration runs automatically at startup or is applied as reviewed SQL. Ask what is tested in staging against a copy of production realms before a minor release is adopted. For SOC 2 evidence, ask which artifacts are delivered (system description inputs, access review exports, change records, logging configuration), who writes them, and who at your organization signs off. Confirm that DeployOpen prepares evidence but that your auditor issues the report. Finally, ask how the fixed-scope agreement lists each deliverable, its acceptance test and the work that falls outside it, such as new tenant onboarding after go-live.

How DeployOpen scopes and delivers Keycloak for SaaS teams

DeployOpen plans, implements, integrates, hardens, documents and supports self-hosted open-source platforms inside your own cloud accounts, data centers or air-gapped networks. For SaaS and technology companies, that means a Keycloak design built around your tenant model, your customers' identity providers and the evidence your SOC 2 auditor will ask for.

How we scope

  • Map your tenant model, including which customers need their own identity provider and which share a realm or organization.
  • Inventory the applications, APIs and workforce systems that will sign in through Keycloak, with their protocols (OIDC or SAML).
  • Agree deliverables, environments, integrations and timelines in a written, fixed-scope document before work starts.

How we build

  • Configure realms, organizations, clients and per-tenant identity brokering, with onboarding steps defined and tested end to end.
  • Set up the production database, TLS, reverse proxy path restrictions and separate admin hostname before any customer traffic arrives.
  • Test sign-in, token lifetimes, logout and access boundaries between tenants, and document each result for review.

How we hand over

  • Deliver configuration as code and runbooks covering onboarding, offboarding, admin access and upgrade steps.
  • Provide control mapping and access evidence for your SOC 2 Type 1 or Type 2 examination, prepared for your auditor to review.
  • Walk your platform and security teams through operations, monitoring and recovery so the handover is complete.

How we support

  • Offer ongoing support, upgrades and continuous security testing as a retainer after the initial handover.
  • Plan Keycloak minor-release upgrades with a tested rollback path and a database migration approach agreed in advance.
  • Confirm with us which support scope, response expectations and reporting your team needs before the retainer is signed.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.