OpenEMR SSO with LDAP, Active Directory and Google

Staff logins in OpenEMR can check against LDAP, Active Directory or Google Sign-In, and third-party apps can reach FHIR data through OAuth 2.0 and OpenID Connect. This page covers the decisions, build sequence, effort drivers and checks for each.

On this page

How OpenEMR SSO with LDAP or Active Directory changes daily access

Directory login means staff type the password they already use, and LDAP or Active Directory checks it, but OpenEMR still requires a matching user record before anyone gets in. Google Sign-In and SMART on FHIR app access are configured separately, so each one needs its own decision about who can use it and what it can read. The directory checks the password, OpenEMR decides the role, and that split is where most of the work sits.

This is harder than it looks because the directory and OpenEMR each keep their own account lifecycle. A nurse who leaves the clinic may be disabled in Active Directory but still hold an active OpenEMR user with clinical permissions, and a rehired employee may get a second OpenEMR account under a new username. Duplicate identities also appear when a locum or contractor exists in the directory under one name and in OpenEMR under another. The gap between who can authenticate and who holds a clinical role is the risk to plan for: a valid directory login is not evidence that the person should see a specific patient chart, sign a prescription or export data.

The exact settings, the login flow and the administration screens depend on the OpenEMR version in use. Login with directory credentials arrived in version 6.0.0 and Google Sign-In in version 6.1.0, and the current line is version 8, so confirm which version your installation runs before you copy any configuration from older guidance. Ask your implementer to document the account matching rule, the deprovisioning steps and the owner of each OpenEMR user record before go-live.

Which OpenEMR login paths and identity components are involved

OpenEMR SSO is not one switch. Several components decide who can sign in, which credentials are checked, and what a third-party app can read. Each one stores different data and depends on different settings, so confirm them separately before go-live.

OpenEMR local user store

OpenEMR keeps its own user records, including the username, role and access rights that govern what each clinician or staff member can open. Even when a directory checks the password, the user must still exist in OpenEMR. Plan who creates these records, who removes them when staff leave, and how roles map to your existing job functions. Confirm the exact settings in the Administration Globals documentation for your version.

Administration Globals

LDAP or Active Directory directory

The directory verifies the password for users who already exist in OpenEMR. It does not replace the local record, so a directory account with no matching OpenEMR user cannot sign in. Check which directory attribute matches each OpenEMR username, how disabled or locked accounts are handled, and whether a directory outage blocks all clinical logins. Ask your directory team to test with a non-production account first.

Google Sign-In

Google Sign-In is a second login path added in OpenEMR 6.1.0. It depends on a Google identity matching an existing OpenEMR user, so the account mapping must be settled before rollout. Decide whether personal Google accounts are permitted at all for clinical access, and confirm whether your organization's Google Workspace policies, such as session length and MFA enforcement, apply to these logins.

Password and MFA policy

Password rules for local accounts are set in OpenEMR and apply to any login that is not delegated. Version 6.0.0 added length limits, a rule requiring all four character types, reuse prevention, expiration and a choice of hashing method. The Securing OpenEMR guide also recommends multi-factor authentication. Confirm which of these controls still apply to directory or Google logins in your version, because a directory may enforce its own rules.

Prior passwords blocked
5
Securing OpenEMR

FHIR API authorization with OAuth 2.0 and OpenID Connect

Third-party apps reach OpenEMR through the FHIR API, which uses OAuth 2.0 and OpenID Connect, and SMART on FHIR v2.2.0 defines how apps request launch context. Public apps, such as browser or mobile apps that cannot keep a secret, use PKCE. Each app is registered and approved by an administrator, so confirm who can approve apps and how client secrets are stored and rotated.

FHIR README

Granular scopes that limit app access

Scopes define which FHIR resources an app may read or write, and OpenEMR supports granular scopes. A broad scope on a patient-facing or analytics app can expose far more clinical data than the use case needs. Review each requested scope against the app's purpose, record approvals in your change process, and test that an app with a narrow scope cannot reach unrelated patient records. Confirm the scope list for your release.

How a directory login and a SMART app authorization flow through OpenEMR

The left flow starts when a staff member submits credentials in the browser. OpenEMR checks them against the LDAP or Active Directory server, or hands sign-in to Google, then confirms a local OpenEMR user record exists before a session starts. The right flow starts when a FHIR client app redirects the user to OpenEMR's authorization step. The user approves the requested scopes, and OpenEMR issues a token limited to those grants, which the app then presents when it calls the FHIR API. Check the directory boundary, the local user match and the granted scopes at each hand-off.

Directory sign-in and SMART app authorization as separate flows through OpenEMR.

Which identity source and app pattern fit your organization

This table compares the four main ways to sign in to OpenEMR and to admit third-party SMART apps, with the operational cost each one leaves with your team. Read each row against your directory hosting model, which you should confirm first as on premises or cloud hosted, since that determines how LDAP or Active Directory is reachable from OpenEMR. The main takeaway is that every option moves some work to your team, whether that is group maintenance, a second identity store, password policy ownership or client secret handling.

OptionWhen it fitsOperational cost to plan for
Directory login only (LDAP or Active Directory)Staff already live in one directory and you want one password and one offboarding stepDirectory group maintenance, a network path from OpenEMR to the directory, and the directory's password policy becomes the policy staff live under
Directory login plus Google Sign-In for some rolesSome roles, such as contractors or locum clinicians, are not in your directory but have Google accounts you can manageA second identity provider to manage, separate account disablement steps, and a need to confirm which role maps to which sign-in path
Local OpenEMR passwords with MFASmall sites without a directory, or where the directory cannot be reached from the OpenEMR hostYour team owns password policy, expiration and reuse rules, MFA enrollment and recovery, and every offboarding happens inside OpenEMR
Confidential SMART app (server-side client secret)A third-party app runs on a server you control and can store a client secret securelySecret storage, rotation and revocation are your responsibility, and each app registration needs an owner who reviews its scopes
Public SMART app (PKCE)A browser or mobile app cannot keep a secret, such as a patient-facing or device-based appRelies on PKCE and granular scopes for protection, so app review and scope limits carry more weight than a stored secret

How to configure OpenEMR SSO with LDAP or Active Directory

This sequence connects OpenEMR logins to an existing LDAP or Active Directory service, adds Google Sign-In as a separate layer, and confirms each path with a successful login, a denied login and a tested SMART on FHIR client. Each step closes with a check you can record before moving on.

  1. Confirm version, PHP and database requirements

    The infrastructure or platform engineer records the OpenEMR version in use or planned, then checks it against the PHP and database requirements in the release notes for that version. Recent releases require PHP 8.3 or later and a MySQL- or MariaDB-compatible database, so confirm the installed PHP and database versions match. Also confirm the version's exact field names for LDAP, Active Directory and Google settings in the Administration Globals wiki, because options change between releases. Done when you have a written version record and a matching test environment that you can reach over HTTPS.

  2. Create a dedicated read-only bind account

    The directory administrator creates a service account used only by OpenEMR to search the directory, with read access limited to the user objects and attributes OpenEMR needs, such as the login name and the group or attribute used for access. The account should not be a personal administrator account, and its password should follow your directory's service account policy. Ask the directory team to confirm which search base and filter they want OpenEMR to use. Done when the directory team confirms in writing that the account can search the chosen base and cannot modify objects.

  3. Configure the directory connection in OpenEMR

    An OpenEMR administrator enters the directory server address, the search base, the bind account and the login attribute in the administration settings, using the field names confirmed for your version. Keep the connection on encrypted transport as your directory supports it, and do not leave test settings in place after the trial. The OpenEMR wiki describes that directory login validates the password against the directory, but the user must still exist in OpenEMR. Done when the settings save without error and a directory search from the administration side returns the pilot users.

  4. Create matching OpenEMR users and roles for a pilot group

    The OpenEMR administrator creates user records for a small pilot group whose usernames match their directory logins exactly, and assigns each one an OpenEMR role that reflects their clinical or administrative duties. Because a directory login alone does not grant access, every user who should sign in needs an OpenEMR record. Document which directory group maps to which OpenEMR role so reviewers can trace access. Done when each pilot user's record exists, the role list matches the approved access matrix, and the access review has signed off.

  5. Test one successful login and one denied login

    The tester signs in with a pilot account that exists in both the directory and OpenEMR and confirms the correct role and landing page appear. Then the tester attempts sign-in with a directory account that has no OpenEMR record, and with a correct directory account whose password is wrong, and confirms both are refused. Record the time, the account and the result of each attempt, and review OpenEMR's audit logging to confirm the events were captured. Done when the successful login, both denied logins and their audit entries are documented.

  6. Add Google Sign-In as a separate step

    After directory login is verified, the administrator enables Google Sign-In in OpenEMR, entering the OAuth client details created in the Google Cloud console and the field names confirmed for your version. Google Sign-In is configured on its own so a problem with one provider does not hide faults in the other. Confirm which Google domains are allowed and which OpenEMR accounts they map to. Done when a pilot user signs in with Google successful, and a Google account outside the approved domain or without an OpenEMR record is refused and logged.

  7. Register and test one SMART on FHIR client

    The integration engineer registers a single third-party application in OpenEMR's OAuth 2.0 client settings, choosing only the scopes that application needs, and uses PKCE if the app is a public client. The OpenEMR FHIR README describes OAuth 2.0 and OpenID Connect support, SMART on FHIR v2.2.0 and granular scopes, so confirm the app's launch flow and scopes against that documentation. Test that the app obtains a token, reads only the authorized resources, and is refused a resource outside its scopes. Done when the test results show the expected access and refusal, and the client is recorded in your application inventory.

OpenEMR SSO for SMART on FHIR apps by client type

A confidential app runs on a server the organization or vendor controls, so it can keep a client secret out of end-user hands and authenticate itself when it exchanges an authorization code for tokens. OpenEMR's FHIR API uses OAuth 2.0 and OpenID Connect, and SMART on FHIR v2.2.0 defines how the app discovers the server and requests patient or user context. Ask the app team to define its launch flow before registration, because the scopes and redirect targets follow from it.

  • Registration details: the application name, the exact redirect URI list, the requested SMART scopes, and whether the app launches from EHR context or standalone.
  • Scope limits: request only the resource types and read or write permissions the workflow needs. Granular scopes in OpenEMR's FHIR API let administrators approve a narrower set than the app asks for, so confirm what is actually granted.
  • Consent and expiry: confirm who clicks consent (the clinician, an administrator or both) and how long access and refresh tokens live in the configured settings, then test revocation.
  • Redirect URIs: the app team should confirm each URI is HTTPS, fixed, and free of wildcards, and that it matches the registered value character for character.
  • Secret storage: the client secret belongs in a secrets manager or environment store with rotation and access logging, never in source control or front-end code.

Before go-live, check that the registered scopes and token lifetimes match the written data-use justification your privacy and security teams approved.

Securing OpenEMR logins with MFA, password policy and secrets handling

Once OpenEMR authenticates users against LDAP, Active Directory or Google, the login path becomes the main control point for access to patient records. The cards below cover the controls that protect that path: transport, multi-factor authentication, password rules, directory credentials, exposed scripts and the logs that show what SSO did.

HTTPS only on port 443

Serve OpenEMR only over HTTPS and expose only port 443 to users where your network design allows it. Sign-in credentials, directory bind responses and OAuth redirects all pass through the browser, so plaintext access would expose them. Confirm the certificate chain, redirect rules for any plain HTTP requests and that the same rule applies to the FHIR endpoints used by SMART on FHIR apps.

Securing OpenEMR guide

Multi-factor authentication for every login

The Securing OpenEMR guide recommends multi-factor authentication. Directory passwords alone are weak when a single password unlocks clinical records, so decide whether the second factor is enforced in OpenEMR, at the identity provider or both. Ask which accounts are exempt, such as break-glass or service accounts, and how their use is reviewed.

Password rules from version 6.0.0

OpenEMR 6.0.0 added password length limits, a rule requiring all 4 character types, reuse prevention for up to 5 prior passwords, expiration settings and a choice of Bcrypt, Argon or SHA512 hashing. When LDAP or Active Directory validates the password, confirm which rules apply in the directory and which apply in OpenEMR, so users are not held to two conflicting policies.

Administration Globals settings

Protecting the bind account and client secrets

The LDAP bind account and the Google or OAuth client secrets let OpenEMR query the directory and trust identity tokens. Use a read-only bind account limited to the search base needed, store its credentials outside the web root and rotate them on a schedule. Restrict who can view the OpenEMR configuration screens, since those screens can expose or change these values.

Removing setup and admin scripts

After installation, remove setup.php and other administrative scripts from the web-accessible directory, as the Securing OpenEMR guide advises. Block direct web access to sites/*/documents so uploaded files cannot be fetched by URL. Test these checks after every upgrade, because a new release can restore files you removed.

SSO and admin event logging

Log successful and failed sign-ins, directory lookups, Google sign-in events, OAuth token issuance and changes to authentication settings. Confirm where OpenEMR and the web server write these logs, how long they are kept and who reviews them. Without this trail, a compromised directory account or a misconfigured app cannot be traced to the time and source of access.

What drives SSO effort and cost in an OpenEMR deployment

This table lists the factors that change how much work an OpenEMR SSO project involves, how each one raises effort and what keeps it manageable. Read it before requesting a quote, and use the last column to see which items a written scope should spell out. The main takeaway is that a small role model, a pilot group and a fixed list of apps usually matter more than the choice of directory.

DriverWhy it changes effortHow to keep it down
User groups and rolesEach group must map to an OpenEMR access role, and every mapping needs testing for allowed and denied actions.Agree one role model before build, and limit group-to-role mappings to the roles that clinical and billing staff truly use.
Directory structureA single domain with one bind account is simpler than several domains or forests, where lookups, trust and failover must be designed and tested.Confirm the directory layout with the directory team early, and limit the first release to the domain that holds the OpenEMR users.
Google Sign-InGoogle login adds a second identity path, so account linking, unmatched accounts and offboarding must work the same as directory logins.Decide whether Google is needed at all, and if so, limit it to a defined user group with a rule for accounts that do not exist in OpenEMR.
Third-party FHIR apps and scopesEach app registered for OAuth 2.0 or SMART on FHIR needs its own redirect settings, scope review and access testing, and public apps need PKCE.Keep a fixed list of approved apps with the scopes each one needs, and add new apps through a single review step.
EnvironmentsTest, staging and production each need their own directory connection, client registrations and redirect addresses, so configuration is repeated and kept in step.Use a documented configuration checklist and promote settings between environments instead of rebuilding them by hand.
Audit and compliance evidenceAssessors may ask for login logs, role change records, MFA settings and offboarding samples, and each request adds collection and write-up work.Ask up front which evidence the compliance team needs, and define where logs are kept and how long they are retained.
Existing MFA infrastructureReusing the organization's identity provider or MFA service requires integration and testing, while OpenEMR-only MFA is a separate build.Confirm which MFA service is the system of record and whether OpenEMR can use it, before the scope is written.
Pilot and rolloutA phased rollout to all clinics at once multiplies support questions, password resets and exception handling.Start with one pilot group, define exit criteria, and expand only after the pilot's login issues are resolved.

How to test OpenEMR SSO logins and fail safely

Write down the expected result for every login case before the first test runs. A test matrix that lists each case and its expected outcome turns testing into a check against a decision you already made, rather than a judgment call made under pressure. Cover at least these cases: a valid directory login, a wrong password, a disabled directory account, a directory user with no OpenEMR record, a user removed from a directory group that grants access, and a Google login for an address that was never provisioned in OpenEMR. Add the FHIR side of the matrix: an expired or revoked app token, and a request for a scope the app was not granted. For each row, name the expected outcome, the log entry you expect to see and the person who signs off on the result. Confirm with your own configuration which group and provisioning rules the directory and OpenEMR apply, because the expected results depend on them.

A safe failure has three visible properties. The attempt is denied at the point of login or API call, so the user reaches no OpenEMR screen and the FHIR endpoint returns an authorization error instead of data. No partial session is created, meaning no half-authenticated user record, no cached role and no token that works for some resources but not others. The attempt leaves a clear log entry that identifies the account, the method (directory, Google or app token) and the reason for refusal. Check each property on every failing row, not just that a login was refused. Verify the audit trail in the same environment you will run in production, and confirm with your team which OpenEMR and web server logs your security function will review and where they are retained.

Run the matrix in a non-production copy that uses the same directory and Google settings as the target environment, and use test accounts that match each row. Repeat the disabled-account and group-removal cases after the directory change has propagated, since a login that still succeeds at that point is a finding, not a timing quirk. Record each result against its expected value, file any mismatch as a defect with the steps to reproduce it, and retest after the fix. Keep the completed matrix with the change record, because it is the evidence a compliance reviewer will ask for when they assess access control for this system. Ask your security team to review the test accounts and the test data for any real patient information before the run starts.

What buyers ask before configuring OpenEMR SSO

Can our in-house team configure OpenEMR SSO without a partner?

Yes, a team with directory and PHP experience can usually do it, but the work crosses three areas: OpenEMR settings, the directory or identity provider, and the security review that follows. OpenEMR added LDAP and Active Directory login in version 6.0.0, and Google Sign-In in version 6.1.0, so the configuration is built into the application. The questions to settle first are who owns each side, whether anyone has tested a failed login and a locked account, and whether the team can document the result for an assessor. A partner adds value mainly when those hand-offs are unclear or when the evidence must be prepared for an external review.

What drives the cost and timeline of OpenEMR SSO work?

The main drivers are the number of identity sources, the state of the existing directory, and how many applications need to sign in through it. A single Active Directory domain with clean user records is a much smaller task than several directories, nested groups, or a backlog of duplicate accounts. Google Sign-In adds its own consent and domain checks. Testing against staging copies, documenting access rules, and preparing evidence for a compliance review also add effort. Ask any quote to break these into separate line items so you can see which ones your team could absorb.

What does the directory and security team need to provide?

The directory team needs to supply a service account with read access, the search base and group structure, and a decision on which groups may log in to OpenEMR. The security team should set the password policy, decide on multi-factor authentication, and approve how sessions expire and how failed logins are logged. OpenEMR's Administration Globals settings control password length, complexity, reuse, and expiration, and the Securing OpenEMR guide recommends multi-factor authentication and strong password policies. Agree these decisions before configuration starts, because they change what the application will accept.

Does Google Sign-In replace directory login in OpenEMR?

No. Google Sign-In verifies who the person is, but OpenEMR still needs a matching user record to decide what that person can do. The account must exist in OpenEMR with the right role and access before a Google login will succeed. The same rule applies to LDAP and Active Directory, where OpenEMR checks the password against the directory but still requires the user to exist locally. Plan user provisioning and offboarding for OpenEMR accounts as a separate process, so a removed employee does not keep working access.

How does SMART on FHIR app access differ from staff login?

Staff login identifies a person who uses the OpenEMR interface. SMART on FHIR app access identifies a third-party application that requests data through the FHIR API, using OAuth 2.0 and OpenID Connect. OpenEMR's FHIR API implements SMART on FHIR v2.2.0, PKCE for public apps, and granular scopes, so each app receives only the permissions it asks for and the admin approves. Treat app registration, scope review, and client credential handling as a separate workstream from directory login, and confirm which apps your clinical workflows actually need.

What should we confirm about the OpenEMR version before starting?

Confirm the exact OpenEMR release, the PHP version, and the database engine, because the release determines which SSO options and FHIR features are available. Recent releases require PHP 8.3 or later and run on a MySQL- or MariaDB-compatible database. The project's home page says users should upgrade to version 8 by March 1, 2026 to keep active ONC certification, and the security fixes in 8.3.0 and 8.4.0 affect FHIR APIs and the patient portal. Check the current release notes on the GitHub releases page before scoping, since security releases may change the configuration you plan.

What should a fixed-scope quote for OpenEMR SSO include?

A fixed-scope quote should name each identity source, each application or FHIR client in scope, and the OpenEMR version it targets. It should list the deliverables, such as configuration records, a test plan with failed-login and lockout cases, runbook notes, and a rollback procedure. It should separate one-time work from recurring items like certificate renewal, directory changes, and app onboarding. Ask which parts the client team must do, which dates depend on directory or security approvals, and what happens if the OpenEMR version changes during the work. Scope and deliverables are agreed in writing before work starts.

What to monitor, document and revisit after SSO goes live

Once LDAP, Active Directory or Google Sign-In is working, the ongoing risk shifts to whether identity decisions still match what the directory says. Review login and denied-login logs on a fixed schedule, looking for accounts that authenticate through the directory but have no matching OpenEMR user, repeated failures against one account, and logins from users who should have left the practice. Confirm with your own team how long OpenEMR and your directory retain these records, and whether they reach your central log platform. Also check that directory group changes flow into OpenEMR roles. Remember that the directory only validates passwords, so an OpenEMR user record must still exist and carry the right access. A removed directory group that leaves an active OpenEMR account is a common gap.

The bind account used for LDAP or Active Directory lookups and the OAuth client credentials used by SMART on FHIR apps are both long-lived secrets. Agree a rotation schedule with the client, record who owns each credential, and rotate it through a documented change so that the patient portal, scheduling and third-party apps do not fail silently. Ask your implementation partner to confirm which settings must be re-entered after a rotation and whether any cached sessions need to be cleared. Keep the bind account read-only and limited to the search it needs.

Retest after every OpenEMR security release. The FHIR API, the patient portal, billing, the fax and SMS module and the fee sheet all had security fixes in the 8.3.0 and 8.4.0 releases, so SMART app configuration, scopes and PKCE behavior should be checked again after each upgrade rather than assumed to be unchanged. Keep a current record of identity settings, registered apps, granted scopes and each app's business owner, and update it whenever an app is added, changed or retired. This handover document is the artifact auditors ask for first when they review access to patient data, so it should be dated, version controlled and reviewed by someone outside the team that configured the system.

How DeployOpen scopes, builds and hands over OpenEMR SSO work

DeployOpen plans, implements and documents OpenEMR SSO inside your own infrastructure, so the identity setup can be reviewed by your security and compliance teams. We agree scope and deliverables in writing before work starts, then test the login paths, hand over the configuration and offer ongoing support if you want it.

How we scope

  • Inventory which OpenEMR user types need LDAP, Active Directory or Google sign-in and which stay local.
  • Confirm directory details, group mappings, account provisioning and how OpenEMR users are created before login.
  • Agree the written scope, deliverables and timeline with you before any build work starts.

How we build

  • Configure LDAP or Active Directory authentication and Google Sign-In in your environment, with test accounts for each path.
  • Set up OAuth 2.0, OpenID Connect and SMART on FHIR app access, including client registration and granular scopes for third-party apps.
  • Test login failures, lockouts, password policy interaction and access for users who should be blocked, then document results.

How we hand over

  • Deliver written configuration records, admin procedures and a test log your team can repeat during reviews.
  • Walk your administrators through adding users, revoking access and registering or removing FHIR app clients.
  • Confirm which settings depend on your directory, Google account or hosting, so your team knows what to recheck after changes.

How we support

  • Support after handover is available as a retainer, covering directory changes, OpenEMR upgrades and app client reviews.
  • Retesting of SSO and app access can follow OpenEMR security releases or changes to your identity provider.
  • Ask any partner, including DeployOpen, to state in the quote who owns the directory, the Google project and the OpenEMR admin accounts.

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.