OpenEMR multi-factor authentication with TOTP and U2F

OpenEMR multi-factor authentication depends on per-user enrollment, so the rollout is partly a process and partly a configuration task. This page covers the TOTP and U2F choice, enrollment tracking, lost-device resets and the policy that closes the gap.

On this page

Why OpenEMR multi-factor authentication is a rollout, not a switch

Multi-factor authentication in a self-hosted OpenEMR system has to be enrolled user by user, because there is no global enforcement switch that requires a second factor for every account. The work is choosing which factors to allow, enrolling each staff account, tracking who has and has not enrolled, and governing how lost devices are reset. A practice or health system exposing OpenEMR to remote or external staff should plan those four tasks before announcing the change, not after.

The Securing OpenEMR guide recommends multi-factor authentication alongside strong password policies and HTTPS-only access, because a stolen password alone should not be enough to open a clinical record. Regulators treat that gap seriously. In September 2026 the French CNIL fined Hopital Prive de la Loire EUR 500,000 under GDPR Articles 32 and 34, in part because external access to its patient record system lacked VPN and multi-factor authentication. The point for OpenEMR operators is that remote access without a second factor is the kind of exposure a reviewer will ask about first.

The HIPAA Security Rule does not mandate multi-factor authentication. It requires unique user identification and access controls, and MFA is one way to support those requirements, so document it as a chosen control with its rationale. Before you commit to a design, confirm in your installed version which second-factor options the built-in capability offers (TOTP applications, U2F security keys, or both), since the factor list and enrollment screens are version-specific and should be checked in your own environment rather than assumed from this page.

TOTP apps or U2F keys: which factor fits which users

This table compares time-based one-time password (TOTP) apps and U2F security keys on the points that shape an OpenEMR rollout, from phishing resistance to recovery. Read each row against your own user groups: clinicians on shared workstations, remote staff and administrators often need different factors. The main takeaway is that U2F gives stronger phishing resistance but depends on hardware each user must have, while TOTP is easier to issue but more exposed to real-time phishing.

ConsiderationTOTP authenticator appU2F security key
Phishing resistanceLower: a six-digit code can be typed into a convincing fake login page and relayed in real timeHigher: the key checks the site's origin, so a copied login page cannot complete the challenge
Device cost to the organizationUsually no hardware purchase if users run an app on a phone they already own, though policy on personal devices must be decidedHardware purchase per user, and usually a spare key for administrators, with cost driven by key count and procurement
Lost deviceUser re-enrolls a new app or phone, which needs a verified reset path before the old factor is removedUser needs a spare key already enrolled, or an administrator reset; a lost key with no backup can lock the account out
Shared workstationsPoor fit: the code lives on one person's phone, so sharing the account defeats individual accountabilityPoor fit for the same reason, and keys can be left in a workstation; suits named users who carry their own key
Remote or clinical staff without issued phonesWorkable if personal phones are allowed, but raises questions about device ownership and data on that deviceWorkable if keys are mailed or issued in advance, which needs a secure shipping and identity check step
Recovery handlingDepends on the OpenEMR version and configuration; confirm whether backup codes or administrator resets are availableDepends on the OpenEMR version and configuration; confirm whether multiple keys can be registered per account
Administrator and high-privilege accountsAcceptable as a baseline, but a stronger factor is usually preferred for accounts that can change settings or export recordsPreferred choice for administrators, since it resists the phishing attacks most likely to target privileged logins

How a second factor fits into the OpenEMR sign-in path

This diagram follows a clinician signing in from a browser. Credentials go to the OpenEMR login form, and the password is checked first. If it passes, the second-factor step asks for a code from a TOTP app or a response from a U2F key held on the user's device. OpenEMR issues a session only after that check. Login failures and enrollment changes are written to the audit log, and an administrator enrolls users and resets lost devices. The trust boundary sits between the user's device and the OpenEMR host. This diagram shows the general pattern only. Confirm the exact order of steps and any per-role bypass in the installed version before you rely on it.

General sign-in path with a second factor, trust boundary and audit point.

Where the gap sits when MFA is optional per user

OpenEMR enforces multi-factor authentication per user, so one unenrolled or unusual account can bypass the control everyone else is using. The four gap types below share a root cause: enrollment and exceptions are tracked by hand, so a reviewer has to look for them deliberately.

Accounts that never enrolled

Any active user without a registered factor logs in with a password alone. Because OpenEMR has no global enforcement switch, a clinician hired last year or a front-desk user added during a busy period can sit outside the policy without anyone noticing. Check the user list against your enrollment records, and confirm which accounts have a TOTP app or U2F key registered. Include inactive accounts that could be reactivated.

Service and shared accounts

Integration users, kiosk logins and shared workstation accounts often cannot carry a personal phone or hardware key. A TOTP secret stored in a shared password manager or a U2F key passed between staff weakens the link between a login and one accountable person. Ask who holds each account, where any second-factor material is stored, and whether the account can be limited to the single function it serves.

Administrators who change factor settings

An administrator who can reset another user's factor, or disable a second factor, can remove MFA from an account without touching its password. This makes admin accounts the highest-value target in the system. Review which roles can reset enrollments, confirm that administrators enroll first, and check that resets leave a record showing who acted and why.

Remote and external access paths

The patient portal, FHIR API clients and other external entry points may authenticate differently from staff logins, so MFA on the clinician screen does not automatically cover them. Map every route that accepts a login from outside your network, then confirm for each whether a second factor applies, which identity it uses and whether the Securing OpenEMR guide recommendations have been applied to it.

Setting up and verifying per-user MFA enrollment

This sequence moves OpenEMR multi-factor authentication from a plan to a verified state, with every enrolled account traceable, sign-in tested against a forced failure, and a recovery path proven before users depend on it.

  1. Confirm the OpenEMR version and factor options

    The platform owner records the exact OpenEMR version in production, including the Docker image tag or package if you deploy that way, and checks the release notes for the MFA options it offers. Confirm in your own environment whether TOTP and U2F are both available, where users enroll (their own profile or an administrator screen), and which admin settings apply. Enrollment screens and admin options differ between versions, so do not rely on this guide or older wiki screenshots. Done when the version, the factor types and the enrollment path are written down in your change record and checked against a test instance.

  2. Set the factor policy by role

    The security owner and the clinical and practice leads agree which roles must enroll a second factor, which factor each role may use, and what happens to users who have not enrolled. Because OpenEMR has no global enforcement switch, this policy is a checklist you run per account, so keep it short enough to audit. Name the roles with access to ePHI, administrative and billing roles, and any account that signs in from outside your network. Done when the policy is a signed one-page document that lists each role, its required factor and the owner who will check enrollment against it.

  3. Pilot with a small administrator group

    Choose a few administrator accounts on a non-production copy of the system and enroll them with each factor type your policy allows, including a backup method for any user who will hold a U2F key. Sign in, sign out and sign in again on each browser the staff use, and note any step where the enrollment screen or the challenge prompt is unclear. Confirm that the administrators can still reach the admin screens after enrolling. Done when every pilot account has completed a successful sign-in with each factor, and the list of confusing steps has been turned into written user instructions.

  4. Enroll production accounts and record each one

    Roll out enrollment in batches by role, starting with the highest-risk accounts. For each account, record the username, role, factor type, enrollment date, the person who verified the identity and the staff member who completed the enrollment. Keep this register outside the EHR so it survives a database restore. Do not accept enrollment requests by email or phone without verifying the requester in person or through a known channel. Done when a reconciliation of the register against the list of active user accounts shows no required-role account without a recorded enrollment, and the gap list is assigned to an owner with a date.

  5. Test sign-in and a forced failure

    Run two tests on a non-production copy and once on production with a test account. First, sign in with the correct password and factor and confirm access. Second, sign in with the correct password and a wrong or expired factor and confirm access is denied and no session or patient data is shown. Also test a wrong password followed by the factor to confirm the second factor is not accepted as a substitute. Record the result of each test with the time and the test account name. Done when all three results match the expected outcome and are attached to the change record.

  6. Verify the audit trail captures MFA events

    Have the security owner check the audit logging configuration in your OpenEMR version and confirm that enrollment, successful challenges and failed challenges each produce a log entry with user, time and source address. Generate one event of each type during testing, then find it in the log store where your team reviews events. If an event type is missing from the logs, record it as a gap and do not assume the MFA system logs it elsewhere. Done when every event type from the tests appears in the central log store, and the list of event types you could not confirm is closed or accepted by the risk owner.

  7. Confirm lockouts and lost-device recovery

    Test what happens when a user is locked out after repeated failures and when a user loses a phone or U2F key. Confirm who can reset enrollment (the administrator, a second approver or the user through a verified route), how the reset is recorded in the register and audit trail, and whether the old factor stops working immediately. Check that a reset does not disable the account's password protection or leave a bypass in place. Done when a reset has been performed on a test account, the old factor is rejected, the new enrollment works, and the reset appears in both the register and the audit log.

Tracking enrollment and closing the gap with policy

Because OpenEMR has no global MFA enforcement switch, the gap stays open until you can see which accounts have enrolled and make enrollment a condition of access. Start by building a roster from the user administration screens or a read-only database query against the users table, then compare it with your active account list from your identity source or HR records. Separate three groups: enrolled, unenrolled and accounts that should not exist. Run this comparison on a fixed cadence and keep each snapshot, so the security owner can see progress over time rather than a single point in time. Confirm in your own version which MFA fields are stored per user and whether the enrollment status is visible in the interface or only in the database, because that determines how much you must script yourself.

Set the enrollment deadline and the consequence together. Require enrollment first for roles that touch clinical data, such as clinicians, nurses, front-desk staff with chart access and anyone with billing or prescribing rights, and then for everyone else. Decide what happens to accounts that miss the deadline: a forced enrollment screen at next sign-in, a restricted role, or disablement. Confirm whether your OpenEMR version can enforce a sign-in rule for unenrolled users; if it cannot, the rule must be applied by a manual step, a directory-side control or your reverse proxy, and you should document which party performs it. Exceptions should be written, approved by the security owner and time-limited, with an expiry date that someone reviews before it lapses.

Shared and service accounts need a separate decision. Per-user TOTP or U2F cannot be tied to a shared login, so the practical answer is to eliminate shared clinical logins where you can and move integrations to named service identities that use the FHIR API's OAuth 2.0 flow rather than an interactive account. Where a shared account must remain, record who uses it, restrict its role and document the compensating control. Report enrollment coverage, exceptions and overdue accounts to the security owner on a set schedule, and treat the report as evidence for your risk assessment. Before you publish the policy, test the enrollment and reset steps with a sample account in a non-production copy, and confirm the behavior of each step in your version.

Resetting a lost device: how the process differs by situation

A TOTP app on a replaced phone is the most common reset. The user still has a working account, so the risk is that someone impersonates them to obtain a new seed. The reset should go through a person who can confirm identity outside the login session, such as an in-person check or a call-back to a number already on file, not through a message the requester can answer from anywhere. The administrator then clears the user's existing TOTP enrollment so a fresh secret can be scanned.

  • Verifier: the administrator or help desk confirms identity through a channel independent of the login, such as a known supervisor or a call-back to the directory number.
  • Performer: an administrator with the user-management permission removes the old TOTP enrollment. Confirm the exact steps for your OpenEMR version in the admin user settings.
  • Logging: record who requested the reset, who approved it, the time, and the user account affected. Keep this in your own ticketing system if OpenEMR's logs do not capture it.
  • User action: the user enrolls the new authenticator immediately at next login and confirms a code before leaving the session.
  • Old secret: the old phone or backup of the authenticator app should be treated as invalid once the reset is done.

Before closing the ticket, confirm the user can log in with the new enrollment and that the old enrollment no longer works.

Security and operational risks to plan for after rollout

Enrolling users is the start, not the finish. The risks below sit in the recovery paths, the admin accounts and the upgrade and restore steps that surround MFA, and each one can quietly reopen the gap MFA was meant to close.

Reset abuse through social engineering

Help desk staff often reset a lost TOTP or U2F enrollment when a caller sounds convincing, and an attacker who has a stolen password can make the same call. Require a verified identity check before any reset, and have the reset approved by someone other than the requester. Keep a log of each reset showing who asked, who approved, the reason and the time, so you can review resets for patterns such as several accounts reset in one week.

Recovery codes stored insecurely

Backup or recovery codes, if your configuration issues them, are as sensitive as the password they protect. Storing them in a shared spreadsheet, a ticket or an email thread defeats the second factor. Confirm with your OpenEMR version whether recovery codes are offered at all, define where users may keep them, and test that a code cannot be reused once spent.

Administrator accounts without a stronger factor

Administrators can change global settings, create users and reach patient data across the practice, so they are the highest-value target. Confirm that every administrator account has enrolled a factor, and prefer a U2F security key for these accounts. Review the admin list each month, because accounts created for a project often outlive it without MFA.

Time drift in TOTP codes

TOTP codes depend on the server and the phone agreeing on the current time. A server whose clock drifts, or a phone with manual time settings, produces codes that are rejected, and users respond by asking for resets, which feeds the reset risk above. Keep the server synchronized with a time service, confirm phones use automatic network time, and record lockout and failed-code events so a clock problem shows up as a pattern rather than as scattered complaints.

Enrollment loss during upgrades and restores

Per-user MFA enrollment is stored with the application data. A restore from an older backup can roll enrollments back, and users who enrolled after that backup point may find their factor gone or, worse, an older factor that a departed user still holds. After each upgrade or restore, compare the enrollment list against your pre-change export, confirm that removed staff are no longer enrolled, and keep the export with your change record. Check your backup procedure with your operations team before relying on it.

What to confirm in your OpenEMR version before you commit

Before you commit to a TOTP or U2F rollout, confirm each MFA limit in your own installed version rather than assuming it. Start with the second-factor types the version supports. Check whether TOTP apps and U2F security keys are both available for the user login, and whether either is restricted to a specific login path. Then confirm whether MFA can be enforced by role or only switched on per user. Per-user enrollment is the behavior you should plan around until the documentation or a test shows otherwise. Check the Administration Globals wiki page and the release notes for the version you plan to run, and record the answer in writing.

Next, confirm the reporting and audit behavior. Find out whether enrollment state can be listed without querying the database directly, and whether a reset of a lost device is written to the audit log, by whom and with what detail. Confirm whether the native login is the only sign-in path for the REST and FHIR APIs and the patient portal, or whether those paths bypass the second factor. If a path bypasses it, your MFA policy does not cover that exposure. Also confirm how settings and enrollments behave after an upgrade, and whether they carry across Docker container rebuilds and multisite sites, which may each hold separate configuration. Ask your vendor or the OpenEMR community for written answers on each point.

Verify all of this in a test environment built from the same version, container image and site layout you plan to run in production. Enroll test accounts with each factor type, reset one, run a version upgrade and a container rebuild, then check the audit trail and the API and portal logins. Treat the release notes for your target version as the final word on what changed. Keep the test results with your change record, because they become the evidence your compliance and security reviewers will ask for when they review the rollout.

How much effort does an OpenEMR MFA rollout take and what does it need from us?

What drives the effort of an OpenEMR MFA rollout?

The effort follows the number of accounts, the mix of roles, and how users reach the system. Each account needs its own enrollment, so a site with a few dozen clinicians is a different job from one with several hundred staff across facilities. Role mix matters because administrators, billing staff, clinicians and any external or contracted users may need different factor choices and different reset handling. Your existing identity provider matters too: if you already run LDAP, Active Directory or Google Sign-In through OpenEMR's login options, you need to confirm how MFA interacts with those logins before you change anything. Remote access paths, reset policy and testing needs complete the picture. Each remote path, such as a VPN, a portal or a FHIR client, needs to be checked for whether it bypasses the factor you are enforcing. Reset policy and testing are often underestimated, because a lost-device process has to be written and tried before the first real lockout happens.

Can our own team roll out OpenEMR MFA without a partner?

A small, single-site OpenEMR installation with a clear written policy and a small number of roles can usually be handled by an internal team. The work is configuring the factor options, enrolling each user, recording who has enrolled and writing a reset procedure. It becomes harder when you have many roles, several sites, external access through a portal or FHIR clients, or an identity provider that already controls logins. In those cases the difficulty is less the configuration and more the verification: showing that every login path asks for the second factor, that enrollment is tracked, and that a retest after an upgrade still holds. Many teams hand that verification and the documentation to an outside party so the evidence is independent of the people who built the setup. Either way, the decision should rest on your account count, your access paths and the staff you have available to test them.

What does our team need to provide for an MFA engagement?

Four inputs make the work proceed without delay. First, admin access to a test environment that mirrors production closely enough to test enrollment, login and reset, along with credentials for each role you plan to test. Second, a named policy owner who can decide which roles must use MFA, which factor types are allowed and how lost devices are handled. Third, a current list of accounts and roles, including any shared or service accounts and any external users. Fourth, time for users to enroll. Enrollment is per user, so someone in your organization must schedule it, answer questions and chase people who have not finished. Without these inputs, scope and testing estimates are guesses, and enrollment often stalls in the final weeks.

What is one-time work and what recurs after an OpenEMR MFA rollout?

Initial configuration, the policy decision and the first round of enrollment are one-time work. Once those are done, the setup is documented and tested against your role model. Recurring work is different and easy to forget. Lost and replaced devices generate reset requests for as long as users change phones or keys. Enrollment audits are needed to find accounts that were created after launch or that never finished enrollment. Reviews are needed after each OpenEMR upgrade or security release, because a release can change login, portal or API behavior that your MFA checks depend on. Staff turnover adds a steady stream of new enrollments and removals. Ask any provider to separate the one-time build from these recurring tasks, and to say who performs each one after handover.

What should a quote for OpenEMR MFA include?

A quote should follow from a written scope that names what is covered. Ask for the factor types in scope, such as TOTP authenticator apps and U2F security keys, with a statement of which roles may use which factor. Ask how enrollment is tracked and how the list of enrolled and unenrolled accounts will be produced and reviewed. Ask for the reset procedure for lost or replaced devices, including who may approve a reset and how identity is confirmed. Ask for test evidence: the login paths tested, the roles covered, and the results of retesting after changes. Finally, ask for a handover that includes configuration documentation, the enrollment register, the reset runbook and a plan for reviewing MFA after upgrades. A quote that omits these items is hard to compare with another one, because the scope is not defined.

How is the scope of an OpenEMR MFA engagement agreed?

DeployOpen works on fixed-scope engagements, so the scope, deliverables and timeline are agreed in writing before work starts. In practice, that means you and the provider list the OpenEMR installation, the roles and accounts in scope, the login and access paths to be tested, the factor types and the reset procedure. Anything outside that list, such as a new identity provider integration or a new access path added later, is handled as a written change to the scope rather than absorbed silently. You receive the deliverables named in the agreement, and the written scope becomes the reference for acceptance. Ask any provider to show you a sample scope document before you commit, so you can see how clearly the boundaries are drawn.

How DeployOpen scopes and delivers OpenEMR MFA work

DeployOpen plans, implements, hardens and documents self-hosted open-source platforms inside your own infrastructure, so OpenEMR multi-factor authentication is set up in your environment and not in ours. The work is agreed in a written scope before it starts, and each step is tested and recorded for your security and compliance teams.

How we scope

  • We confirm your OpenEMR version, hosting model and which user groups will need TOTP or U2F enrollment.
  • We record which login paths, including portal and API access, the MFA design must cover in the written scope.
  • We agree the enrollment, lost-device reset and tracking reports as named deliverables before any work starts.

How we build

  • We configure TOTP and U2F enrollment for OpenEMR accounts and test each login path against the agreed design.
  • We set up the enrollment tracking report and verify it matches the accounts actually enrolled in a test environment.
  • We test the lost-device reset procedure and the access restrictions for accounts that have not yet enrolled.

How we hand over

  • We deliver an enrollment runbook covering user onboarding, device resets and the tracking report steps for your administrators.
  • We document the MFA configuration, test results and open gaps so your compliance team can review them directly.
  • We walk your administrators through the procedures and confirm they can run them without our involvement.

How we support

  • Ongoing support, upgrades and continuous testing are available as retainers after the initial handover.
  • We can retest MFA behavior after OpenEMR upgrades or security releases that touch authentication or portal code.
  • Ask any partner, including us, to confirm in writing how MFA changes will be tested before each production rollout.

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.