Keycloak for healthcare

Keycloak can serve as the self-managed sign-in layer for clinical staff, patients and health software products, with access control and logging designed for HIPAA Security Rule review. This page covers the requirements, configuration, integrations and rollout steps.

On this page

Keycloak for healthcare: why sign-in is a HIPAA access control decision

A hospital or clinic that must place its EHR, imaging viewer and patient portal behind one controlled identity layer is making a HIPAA access control decision before it makes a software decision. The HIPAA Security Rule applies to covered entities and business associates for all electronic protected health information they create, receive, maintain or transmit, and its technical safeguards require unique user identification, automatic logoff and encryption controls for the systems that hold ePHI. Keycloak is a reasonable candidate for that identity layer because it is open source under the Apache 2.0 license, supports OpenID Connect and SAML 2.0 for clinical applications, brokers sign-in to upstream directories and identity providers, supports W3C WebAuthn and passkeys, and can run inside the organization's own data centers or cloud accounts so that authentication traffic and logs stay under its control.

For the security and compliance team, the change is that sign-in becomes a system they must design, document and evidence rather than a feature inherited from each application. Ask the implementation team to map every application that touches ePHI to a client, a role model and an access decision, and to show how workforce users, contractors and patients are separated into different realms or identity sources. Confirm how the Keycloak admin console and Administration REST API are exposed, how administrator actions and login events are logged and retained, and how the team will prove unique user identification for each account. Keycloak's production guide calls for TLS everywhere and separate hostnames for administration, and these settings belong in the written design. There is no HIPAA certification: HHS states that no Security Rule standard requires certification and that private certifications do not prevent a later finding of violation, so the deliverable is evidence your own risk analysis can use, reviewed by your compliance program and, where relevant, an independent assessor.

Which HIPAA and sector requirements shape the Keycloak build

This table maps the HIPAA Security Rule technical safeguards, the business associate contract terms and two sector signals to the Keycloak settings and operating records they affect. Read each row as a question to answer in your design: what the requirement asks, which Keycloak area carries it, and what an assessor will want to see. Confirm the final mapping with your privacy and compliance advisers, since HIPAA does not certify software or organizations.

Requirement or signalWhat it means for the Keycloak buildEvidence to keep
Unique user identification (45 CFR 164.312(a)(2)(i), required)Every workforce and patient-facing account needs its own identity. Avoid shared clinical logins, and disable the default admin user after creating named administrators in the master realm.User inventory, admin account list, and records showing shared accounts were retired
Emergency access procedure (45 CFR 164.312(a)(2)(ii), required)Plan break-glass administrator accounts in a separate realm or with strict MFA, stored offline, and tested so clinicians can still reach systems when the identity provider is degraded.Written procedure, sealed credential records, and test results from exercises
Automatic logoff (45 CFR 164.312(a)(2)(iii), addressable)Set SSO session idle and maximum lifetimes per realm and per client, shorter for shared workstations and kiosks. Document the chosen values and why they are reasonable for the clinical setting.Session and token lifetime settings, the risk assessment behind them, and a note on any equivalent measure
Encryption and decryption (45 CFR 164.312(a)(2)(iv), addressable)Require TLS on all Keycloak endpoints, keep the admin console and Administration REST API on a separate hostname, and protect signing keys and database connections.TLS configuration, key rotation records, and the production hardening checklist
Audit controls and integrity (45 CFR 164.312(b) and (c))Enable admin event and user event logging, forward logs to your central store, and keep login failure records in the database. Confirm retention with your records policy.Log pipeline configuration, sample admin event records, and retention settings
Business associate contract terms (45 CFR 164.314(a)(2)(i))If Keycloak is hosted or supported by a vendor that handles ePHI, the contract must require Security Rule compliance, flow the same terms to subcontractors, and require incident reporting to you.Signed business associate agreement, subcontractor list, and incident reporting timelines agreed in writing
NIS2 Annex I health sector (Directive (EU) 2022/2555)Healthcare providers and certain medical device and pharmaceutical makers are listed as high criticality. Where NIS2 applies, identity services that support clinical systems fall under its risk management expectations, so plan for access control and MFA with documented ownership.Applicability assessment with counsel, risk register entries for identity services, and incident handling procedures
CNIL decision on Hopital Prive de la Loire (3 September 2026, GDPR Articles 32 and 34)The fine cited external access to patient records without VPN or MFA and access rights that ignored the care team's need to know. For Keycloak, require MFA for remote and third-party sign-in, and scope roles and groups to clinical need.Remote access policy, MFA enforcement settings per client, and role-to-care-team mapping reviewed by the data protection owner

Choosing a deployment model for workforce and patient sign-in

Clinical staff are usually the largest group with privileged access to electronic protected health information (ePHI), and their identities already live in a directory such as Active Directory or a cloud directory. In most designs, Keycloak brokers sign-in to that existing directory rather than holding a second copy of each person, so the hospital's joiner, mover and leaver process stays the source of truth. A dedicated workforce realm keeps staff policies, admin roles and client registrations separate from patient-facing settings.

  • Brokered directory identity: Use LDAP user federation or an upstream OIDC or SAML identity provider so access follows the directory account and its deprovisioning.
  • Stronger MFA: Require MFA at every sign-in to clinical applications, and consider step-up prompts for records access outside a care team's normal scope.
  • Shorter sessions: Set idle and maximum session lifetimes that suit shared workstations, and check how logout propagates to applications.
  • Unique user identification: Confirm each clinician signs in with an individual account, since shared logins conflict with the HIPAA unique user identification specification.
  • Audit linkage: Keep login events and admin changes in logs that your security team can query.

Confirm with your compliance and clinical informatics teams which roles may reach which records, because the directory's group model often decides the answer before Keycloak does.

Keycloak settings that matter for clinical access

Clinical sign-in combines shared workstations, remote access, and records that auditors will test. The six settings below cover who holds an account, how strong the sign-in is, how long sessions last, where the admin surface sits, and what gets recorded. Each one needs a decision by the security and clinical teams before the realm goes live.

One account per person

Each clinician, administrator and contractor needs one Keycloak account, and that account must belong to one person. HIPAA's technical safeguards list unique user identification as a required implementation specification, so shared logins at nurse stations or ward terminals will not pass a review. If Keycloak takes identities from Active Directory or LDAP through user federation, confirm that the directory holds one record per person and that a leaver's account is disabled in Keycloak as well. Ask how shared workstations will start a per-person session.

HIPAA Appendix A

MFA with WebAuthn and passkeys

Remote and external access to a clinical system should require a second factor. The Keycloak server administration guide documents OTP policies, W3C WebAuthn, passkeys and recovery codes. Passkeys and security keys resist phishing better than a code typed into a form, but only if enrollment is controlled. Decide who can register a new authenticator, how a lost device is replaced, and where recovery codes are issued and stored. Test the flow for locum and travelling clinicians before go-live, since they are the users most likely to need recovery.

OTP and password policies

Realm policies set password rules and OTP parameters such as algorithm, digit count and period. Clinical staff often sign in several times a shift, so these choices affect both security and daily workflow. Align password rules with your written security policy and your HIPAA risk analysis. Avoid rules that push staff to write passwords down near shared terminals. Confirm that the OTP settings work with the authenticator apps your staff can actually install on hospital-issued and personal devices.

Session lifetimes and automatic logoff

HIPAA lists automatic logoff as an addressable implementation specification, so you must assess it, document the decision, and implement an equivalent measure if the standard is not adopted as written. In Keycloak, session idle and maximum lifetimes, along with token lifespans set per client, control how long a sign-in stays valid. A workstation lock alone does not end a Keycloak session or revoke tokens already issued to a browser. Tie the values to workstation lock settings and test what happens when a clinician leaves a shared device unattended.

Admin console on a separate hostname

The Keycloak production guide recommends exposing the admin console and Administration REST API on a different hostname or context path from public frontend URLs. Patients, partners and clinicians should never reach the admin surface through the same reverse proxy rules as the sign-in page. Restrict admin access to a management network or VPN, require MFA for every administrator, and confirm that proxy path restrictions block admin paths on public hosts. Test from outside the network to verify the block.

Production guide

Login events kept for audit

Keycloak records login events, and the 26.8 upgrade notes say login failures are persisted to the database by default. HIPAA's audit controls standard expects activity in systems that hold ePHI to be recorded and reviewable, so these records must be retained, searchable and protected from edits by the people they audit. Decide how long events are kept, export them to your log platform, and confirm who can read or delete them. Event settings are configured per realm, so check every realm that grants clinical access.

Upgrade notes

How clinical and patient logins flow through Keycloak

A clinician or patient browser reaches a reverse proxy over TLS, which forwards public sign-in traffic to Keycloak. Keycloak authenticates against a brokered directory or external identity provider, then issues OIDC or SAML responses to the EHR, patient portal and imaging viewer. The admin console and the metrics endpoint sit behind separate hostnames or interfaces, outside the public path. Check that the database behind Keycloak is synchronously replicated and that admin and metrics access are restricted.

Public sign-in traffic, brokered directories, clinical clients and admin paths are kept separate.

How clinical applications connect over OIDC and SAML

OpenID Connect and SAML solve the same sign-in problem in different ways, and the choice follows the application rather than the hospital's preference. Modern web and mobile clinical apps, including patient portals, scheduling front ends and newer clinical tools, usually support OIDC, so they register as Keycloak clients with a client ID, a confidential or public client type, and an exact redirect URI for each environment. Legacy electronic health record modules, particularly older on-premises or thick-client components, more often support only SAML 2.0, so they register as SAML clients with an entity ID, an assertion consumer service URL, and a signing certificate that the application trusts. In both cases the client definition is where the redirect or assertion endpoint is locked down, so wildcard or loosely scoped redirect URIs should be avoided and each one reviewed during onboarding.

Role and group mapping is where clinical access control actually takes effect. Map Keycloak groups or realm and client roles to the application's own permissions, such as clinician, nurse, billing or read-only, and keep the mapping in a single documented table that the privacy or compliance team can review against the access rules the organization has adopted. Token claims carry these roles into the application, so confirm which claims the vendor reads, whether it expects roles, groups or a custom attribute, and whether it reads them at each sign-in or caches them. For teams that manage configuration as code, the Keycloak Operator provides KeycloakOIDCClient and KeycloakSAMLClient custom resources, which keep client definitions in version control and make changes reviewable. Vendor support is the first gate: confirm in writing which protocols each application supports, which versions are certified, and whether it supports the claim or attribute mapping you plan to use, because an application that only supports SAML cannot be moved to OIDC by configuration alone.

How a healthcare Keycloak rollout is sequenced

The sequence ties HIPAA scoping and vendor contracts to the design decisions that determine who can sign in, what gets logged and how the platform is upgraded later. Each phase closes with evidence that the next phase can rely on.

  1. Scope systems in the HIPAA risk analysis

    Start by listing every system that creates, receives, maintains or transmits electronic protected health information, including clinical applications, portals, reporting tools and the directories that feed them. Compliance, security and clinical owners confirm which applications sit behind Keycloak and which access paths reach ePHI. Work from the Security Rule standards in 45 CFR Part 164 Subpart C and the NIST SP 800-66 Rev. 2 resource guide, which is informational rather than binding. The step is done when each in-scope application has a named owner, a documented data classification and an entry in the risk analysis that points to its identity design.

  2. Confirm business associate contract terms

    Before any vendor or integrator touches identity data or credentials, legal and procurement check that the agreement meets the requirements in 45 CFR 164.314(a)(2)(i): Security Rule compliance, flow-down to subcontractors that handle ePHI, and incident reporting to the covered entity. Ask the implementation partner and any hosting provider to name the subcontractors who would have access to the environment. The step is done when the signed terms cover every party with administrative or data access, and the contract names who receives security incident notices and on what schedule.

  3. Design realms and identity sources

    Decide how workforce staff, contractors, patients and external care partners are separated into realms, clients and identity providers. Map directory sources such as Active Directory or LDAP for clinicians, and decide where brokered identity providers apply. Define role and group models that match the need-to-know rules your access policy requires, and document which attributes travel in tokens. The output is a design record that security and clinical leadership approve, showing each user population, its authentication method and the applications it may reach.

  4. Build the production database and high availability design

    Select a supported production database from the Keycloak list and build it with the replication and failover behavior your continuity plan requires. Keycloak's documented high availability designs need a synchronously replicated database, so the infrastructure team confirms that before choosing a cluster topology. Deploy TLS on all communication, a reverse proxy with path restrictions, and a separate hostname or context path for the admin console and Administration REST API. The step is done when a failover test shows sign-in continues through a planned node or zone loss, and the admin interface is unreachable from public frontend URLs.

  5. Integrate applications in a pilot group

    Connect a small set of applications that represent the main patterns: a web application, a clinical application that needs SAML or OIDC, and a service that uses client credentials. Developers configure clients with the protocol each product documents, and the team confirms redirect URIs, token lifetimes and logout behavior. Pilot users from clinical and administrative roles test sign-in, session timeout and access denial for users outside the care team. The step is done when the pilot owners sign off on each application's access rules and the defect list is closed or formally accepted.

  6. Configure logging and metrics for audit review

    Turn on Keycloak's Prometheus metrics with the metrics flag on the management interface, and route admin and login events to the central log platform. Confirm that login failures are persisted to the database, as the 26.8 upgrade notes describe by default, and set retention to match the audit policy your compliance team defines. Test that a sample sign-in, a failed attempt and an admin change each appear in the logs with the user, time and source. The step is done when a reviewer can trace one test event end to end and the alert routes reach an owner.

  7. Run access review and security testing

    Before production, the compliance lead runs an access review on the pilot realms, checking that unique user identification is enforced, that shared accounts are absent and that emergency access is documented and tested. An independent security team tests the sign-in flows, admin exposure, token handling and multi-factor enrollment. Findings go to a remediation list with owners and retests. The step is done when the access review records are signed and the retest confirms the high-severity findings are fixed. Note that DeployOpen prepares evidence for assessments but does not issue audit reports or certifications.

  8. Cut over and plan staged upgrades

    Move users and applications to production in groups, keeping the previous sign-in path available until the first group has run cleanly. Set the Keycloak Operator to manual approval mode so no update applies without review. For each future upgrade, decide between automatic schema migration at startup and a manual migration where administrators apply the SQL, which the upgrading guide suggests for large deployments. The step is done when the change record shows the cutover date, the rollback point and a written upgrade procedure that the platform owner has tested in a non-production copy.

What compliance teams need from the Keycloak setup

A Keycloak deployment for a covered entity or business associate produces configuration and logs that compliance and security teams review against the Security Rule. The cards below cover the evidence to prepare, the limits of what it proves, and the pending rule change that may alter what reviewers ask for.

Documented access control design

Write down how realms, roles, groups and client scopes map to the Security Rule's access control and unique user identification standards. Reviewers ask who can see electronic protected health information, why, and how that access was granted. Keep a current design record that names each clinical application, its roles and the workforce groups allowed in, and check it against the actual realm configuration before each review.

Security Rule text

Retained authentication and admin logs

Decide where login events, failed sign-ins and administrative changes are stored, who can read them, and how long they are kept. Confirm that admin events are enabled for realm changes and that the logs leave the Keycloak node so a local failure does not erase them. Your retention period should come from your own HIPAA policy and documentation rules, not from a default.

TLS and hardened admin exposure

The production guidance calls for TLS on all communication and a reverse proxy with path restrictions. Serve the admin console and Administration REST API on a separate hostname or context path from public sign-in pages, and restrict them to administrator networks. Record these settings as evidence for encryption in transit and for limiting access to administrative functions.

Keycloak production guide

Using NIST SP 800-66 as a guide

NIST SP 800-66 Rev. 2 gives key activities and sample questions for each Security Rule standard, which makes it a practical checklist for mapping Keycloak controls. HHS lists it as informational, not legally binding, so it supports your analysis but does not establish compliance on its own. Cite it as a method you followed, and document how you applied each standard.

Guide revision date
February 2024
NIST SP 800-66 Rev. 2

Who assesses compliance

DeployOpen prepares configurations, control mappings and evidence, but it does not issue audit reports or attestations. HHS OCR enforces the Security Rule through complaints, compliance reviews and audits, and HIPAA has no certification, so claims of a HIPAA certificate for a Keycloak setup should be treated with suspicion. Ask your privacy and compliance counsel which evidence your assessors expect.

Pending Security Rule revision

HHS proposed a major Security Rule revision on January 6, 2025, and as of October 2026 no final rule has been published. The Unified Agenda projects final action for July 2027, so the requirements may change after your Keycloak design is documented. Build the access control and logging records so they can be updated without redesigning the identity service.

Proposed rule text

What do hospitals and health software vendors ask before a Keycloak build?

What drives the cost and effort of a healthcare Keycloak project?

The biggest cost drivers are the number of applications to integrate, how many user populations need sign-in (workforce, contractors, patients, partners), and how many directories or identity providers must be connected. Effort also rises with the depth of the access control model, the number of clinical applications using SAML versus OIDC, and the amount of evidence the compliance team expects. Costs fall into two groups: the one-time build (design, deployment, integration, hardening, testing and documentation) and recurring work (upgrades, patching, monitoring and support). Software and the Apache 2.0 license carry no license fee for the upstream project, so most spend goes to people and infrastructure. Ask for a quote that lists each application, each identity source and each evidence deliverable as a separate line.

How long does a Keycloak healthcare build usually take?

Duration depends on scope more than on Keycloak itself. A single internal application using OIDC with one directory is a much smaller job than a platform that signs in clinicians, staff and external care partners across several SAML-based clinical systems. The schedule is usually set by the slowest dependency: directory access approvals, application owner availability, clinical validation of sign-in flows, and the change windows for the hospital's network and certificates. No public duration applies to this work, so ask any partner or internal lead to produce a phased plan that separates design, build, integration testing, clinical sign-off and cutover. Keep the high availability and database decisions in the first phase, because changing them late is expensive.

What must our team provide before a Keycloak build starts?

Most delays come from missing inputs rather than from the software. Plan to provide:

  • Read access or a service account to the directories that hold staff and contractor identities, plus a list of attributes the applications need
  • A named owner for each clinical and administrative application, with its protocol (OIDC or SAML), redirect URLs and the roles it expects
  • Inputs to the HIPAA risk analysis, including which systems hold ePHI and which people need which access
  • Clinical sign-off on who can reach which records, including break-glass and emergency access rules
  • Network and certificate details for the production hostnames, and the place where audit logs must be retained

The answers to these inputs shape the design, so gather them before the build schedule is fixed.

Can our internal team build and run Keycloak for healthcare without outside help?

Yes, an internal team can build and run Keycloak if it has the skills and time for the work. The upstream project is open source and the Keycloak server administration guide documents the features a hospital typically needs, including LDAP and Active Directory federation, OIDC and SAML brokering, OTP and WebAuthn, and the Organizations feature. The questions to answer honestly are whether the team has staff who can operate a clustered, TLS-only service with a synchronously replicated database, whether it can keep pace with the release schedule, and who will carry the on-call burden for a sign-in service that clinicians depend on. Many organizations split the work: internal staff own the directory, application owners and clinical decisions, while an outside partner handles the build, hardening, testing and documentation. DeployOpen works this way when a client asks for it, under a written scope.

How does the HIPAA civil money penalty range affect our planning?

The penalty range sets the financial stakes of getting access control wrong, but it does not set the project budget. For penalties assessed on or after January 28, 2026, the inflation-adjusted range under 45 CFR 102.3 runs from $145 per violation (no knowledge) to $2,190,294 per violation (uncorrected willful neglect), with a calendar-year cap of $2,190,294. Those figures mean that a documented, tested and maintained access model is cheaper than an enforcement case, so it is reasonable to fund audit logging, MFA, access reviews and backups as core work. Note that HIPAA has no certification. HHS states that no Security Rule standard requires certifying compliance, so plan evidence for an OCR review or an auditor rather than a certificate.

Does Keycloak require a Red Hat subscription for a hospital deployment?

No. Keycloak is licensed under Apache 2.0 and the upstream project can be installed and run without a Red Hat subscription. Red Hat build of Keycloak is Red Hat's supported distribution based on the open source project and replaces Red Hat Single Sign-On. A subscription buys Red Hat's support and packaging, which some hospitals require for their vendor management or procurement rules. Ask your procurement and security teams whether a supported distribution is a policy requirement, then compare the support terms and the upgrade cadence of each option. The upstream project plans four minor releases a year, so whichever distribution you choose, the upgrade process and testing capacity matter more than the license line item.

What should we confirm about database and high availability before we commit to a design?

Confirm the database and availability design early, because they determine much of the cost and risk. Keycloak supports several production databases, including PostgreSQL 14 to 18 and Microsoft SQL Server, and the default dev-file database is for development only. The project documents three high availability architectures, and both supported designs require a synchronously replicated database. Ask your database team whether a synchronous replica already exists in the clinical hosting environment, which regions or availability zones the service must survive, and how recovery will be tested. Confirm the Keycloak versions and database support with the official database guide before you fix the design.

How should we plan for Keycloak upgrades and evidence for auditors?

Plan upgrades as recurring work with a test environment, a rollback plan and documented change records. The Keycloak 26.8 upgrade notes include enforced SMTP StartTLS, mandatory signature validation of backchannel logout tokens from external providers, and login failures persisted to the database by default, so each upgrade needs regression testing of sign-in, logout and notifications. The Operator documentation recommends manual approval mode to avoid unplanned upgrades. Ask your team to budget for a fixed number of upgrade cycles each year, record each test result, and keep the logs that prove who changed access settings and when. Evidence like this supports a HIPAA review, although it does not replace a risk analysis.

What to ask a partner before signing a healthcare Keycloak scope

Start by asking how the partner has handled clinical application protocols. Keycloak speaks OpenID Connect, OAuth 2.0 and SAML 2.0, but clinical software varies in how it expects tokens, claims, logout and session lifetimes to behave. Ask for examples of OIDC and SAML integrations with EHR, scheduling or imaging applications, and ask which claims they map from directory attributes such as role, department and care team membership. Then ask how they confirm that a relying party rejects tokens it should reject, since a sign-in that works in a demo can still accept the wrong audience or skip signature validation.

Next, ask how the written scope treats business associate and audit evidence. A business associate contract under 45 CFR 164.314(a)(2)(i) is the client's obligation to put in place, but the partner's scope should state which Security Rule controls the partner configures, which documents it produces, and who keeps them. Confirm that the scope names the evidence the partner will deliver for access control, unique user identification, automatic logoff and audit logging, and that you can map each item to the relevant implementation specification in Appendix A to Subpart C. HHS does not certify compliance, so ask the partner to explain in writing what it will and will not claim. The partner prepares evidence; it does not issue audit reports.

Finally, ask three operational questions and get the answers in the scope. First, how is access control and logging tested: ask whether the test covers failed logins, admin actions, realm and client configuration changes and log retention on the metrics and event pipelines, and who reviews the results. Second, who holds the admin credentials, realm signing keys and database secrets after handover, and how are they rotated and recorded? Third, how are upgrades and retesting retained? Ask for the upgrade method, whether the operator uses manual approval mode, and whether a retest after each release is included or priced separately. Confirm these terms in writing before work starts.

How DeployOpen scopes and delivers Keycloak for healthcare

DeployOpen plans, implements, hardens, documents and supports self-hosted Keycloak inside your own infrastructure for healthcare organizations and health software vendors. Each engagement starts from a written scope that fixes deliverables and timelines before any build work begins.

How we scope

  • Map workforce, patient and partner sign-in paths, and which clinical applications need OIDC or SAML integration.
  • Record the HIPAA access control and audit settings your compliance team needs to review, including unique user identification and automatic logoff.
  • Agree the hosting model, database choice and high availability design in writing before any build work starts.

How we build

  • Configure realms, clients, roles and identity brokering against your directories and upstream identity providers.
  • Set up MFA, session timeouts, admin console exposure and audit logging, then test each control against the written scope.
  • Run security testing of the sign-in flows and admin endpoints, and deliver fixes with a retest of the findings.

How we hand over

  • Document the configuration, integration patterns, runbooks and evidence your security and compliance teams can review.
  • Walk your operations team through upgrades, database migration, backups and recovery procedures for the deployed design.
  • Provide a handover record listing configured controls, open items and the decisions your organization still needs to confirm.

How we support

  • Offer ongoing support, upgrades and continuous testing as a retainer, scoped separately from the initial build.
  • Plan Keycloak minor and major version upgrades with you, including reviewing upgrade notes for changes that affect your clinical integrations.
  • Prepare access control and authentication evidence for your compliance reviews, while independent auditors issue any assessment outcome.

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.