OpenEMR OAuth2 client registration and FHIR scopes

Every app that reads OpenEMR data through the FHIR API needs a registered OAuth2 client with approved scopes. This page explains how to register, scope and audit those clients so only the apps you approved can reach patient data.

On this page

How OpenEMR OAuth2 client registration controls which apps read patient data

A clinical app, patient portal or analytics tool that needs FHIR access forces the security team to answer two questions: who approved this application, and what can it read? In OpenEMR, the answer sits in the OAuth 2.0 client registration and the scopes granted to each client. OpenEMR's FHIR API supports OAuth 2.0 and OpenID Connect, with PKCE for public apps and granular scopes, and the app model is SMART on FHIR v2.2.0. Registration and scope selection are therefore the main gate between an application and patient records, so they deserve the same review as a new user account with broad clinical access.

Before you approve any client, confirm the exact registration path, administrator screens and endpoints for the OpenEMR version you run. The OpenEMR FHIR README is the reference to read against your running release, because the registration workflow and scope names are version-specific and this page does not restate them. Ask your platform team to record the version, the enabled registration mode and who in your organization holds the administrator role that can approve clients. Treat every registered client as an access grant that needs an owner, a stated purpose and a named approver.

Review each request against what the application actually needs. An illustrative example: a scheduling companion that only reads appointments should not receive scopes for clinical notes or billing. Confirm with the vendor which scopes the app requests, whether it runs as a confidential client with server-held secrets or a public client using PKCE, and how it authenticates. Record the decision, then re-check the client list after each OpenEMR upgrade, since security releases in 2026 changed FHIR API behavior and an old approval may no longer match the current code.

What you need before registering an OpenEMR OAuth2 client

An OAuth2 client is only as safe as the OpenEMR instance it reads from. The items below confirm the platform, network, identity and accountability layers are in place before any application is approved to request patient data. Work through them in order, because later decisions about scopes and client types depend on the earlier ones.

Supported OpenEMR 8.x release

Confirm the instance runs a supported 8.x release and that the host meets the stack the release requires: PHP 8.3 or later and a MySQL- or MariaDB-compatible database. Check the version in the administration interface and against the project's release notes before you begin. Record the exact version in your change register, because client registration behavior and FHIR settings are tied to the release in use.

OpenEMR releases

Patch level for FHIR security fixes

The 8.3.0 and 8.4.0 releases fixed security vulnerabilities in the FHIR APIs, along with the patient portal, billing, fax and SMS module and fee sheet. Confirm your instance is on 8.4.1 or a later release that includes those fixes before go-live, and check whether any earlier build was ever exposed to the network. Treat this as a gate: an unpatched FHIR endpoint should not receive client registrations.

Release history

FHIR API enabled for the target site

The FHIR API is controlled per site, so a multisite or multi-facility deployment must enable it for the specific site the application will read from. Confirm the setting is on only for the sites that need it, and that the sites you do not intend to expose remain closed. Record which site IDs are open, since each registered client will be bound to data in that site.

FHIR README

TLS on the public base URL

Every OAuth2 authorization, token and FHIR request runs over the public base URL, so that URL must use HTTPS with a valid certificate chain that clients trust. Allow only HTTPS at the web server, and confirm that the redirect URIs you plan to register also use HTTPS. Check the certificate expiry date and the renewal process, because an expired certificate stops every registered application at once.

Identity source for approved apps

Decide which user accounts an approved application will act for. Launches and token grants depend on OpenEMR users that already exist, and LDAP or Active Directory logins still require the user to exist within OpenEMR. Confirm that the users, roles and multi-factor settings for these accounts follow your access policy, and that no shared or generic login will be used to authorize an app.

Named owner for each application

Assign one accountable person to every application you plan to register, with a backup. The owner approves the requested scopes, confirms the business reason for each data type, sets the review date and decides when a client is retired. Without a named owner, stale clients and scopes accumulate because nobody is responsible for revoking them.

Confidential or public: choosing the client type for each app

Server-side applications run on infrastructure your team or the vendor controls, and the code never reaches the user's browser. That makes them candidates for confidential client registration, where the application authenticates itself to OpenEMR's token endpoint using a client secret or a key pair published through a JWKS endpoint. Key-pair authentication is generally the stronger option because the private key never has to be shared with the authorization server, but the exact methods OpenEMR accepts must be confirmed in the OpenEMR FHIR README before you design around them.

Before approving a confidential client, verify:

  • Secret or key storage: Private keys or client secrets sit in a secrets manager or hardware-backed store, not in source control, container images or configuration files readable by other workloads.
  • Key rotation: You have a documented way to rotate the key pair or secret, and you know whether OpenEMR can hold more than one active key during the switchover.
  • Redirect URI restriction: Each registered redirect URI is an exact match for a known application callback, with no wildcards or open paths.
  • Justified scopes: Each scope requested maps to a named clinical or operational function, and the application does not ask for write access it does not use.
  • Workload identity: The process that holds the key runs under a dedicated service account with no shared administrative access.

Confirm the exact authentication methods, token lifetimes and rotation behavior with the OpenEMR version you run, since these details change between releases.

Every FHIR request is checked against the scopes the app was granted

The flow starts in the user's browser, where the app sends the user to the OpenEMR authorization server with its client_id, registered redirect URI, requested scopes and a PKCE challenge. OpenEMR checks the redirect URI against the registration, then handles login directly or through a configured identity source. The app exchanges the returned code for an access token, authenticating as a confidential client or proving the PKCE verifier as a public client. The trust boundary sits around the OpenEMR site, so the app receives a token and never a user's password. The FHIR resource server checks the granted scopes on each request.

Token issuance and per-request scope checks between the app, browser and OpenEMR.

Registering the client and granting scopes in order

This sequence takes an application from an unconfigured request to a registered OpenEMR client with approved scopes, verified against a non-production patient set and recorded for audit. Each step closes with a check the team can repeat before go-live.

  1. Confirm the FHIR API is enabled for the site

    Before any client work, the OpenEMR administrator confirms that the FHIR API is enabled for the site that will host the application, and that OAuth 2.0 and SMART on FHIR are switched on in the running version. Confirm the exact location of these settings in your installed version rather than relying on older documentation, and record the site identifier used in the base URL. The step is done when the FHIR capability statement responds on the non-production site and lists the expected FHIR R4 and SMART on FHIR capabilities.

  2. Decide the client type for each application

    The application owner and security lead choose between a confidential client, which can keep a secret or hold a private key on a server, and a public client, such as a browser or mobile app, which must use PKCE because it cannot keep a secret. Document the decision with the application's architecture diagram and where tokens will be stored. The step is done when each application has one recorded client type and the reviewer has signed off that no public app is configured to hold a static secret.

  3. Register the client with redirect URIs and key handling

    A administrator registers the client in OpenEMR, either through dynamic client registration or the admin interface once the menu path is confirmed in the running version. Enter exact redirect URIs with no wildcards, and for confidential clients choose JWKS-based client authentication with a published public key set, or a secret stored in the application's secrets manager if JWKS is not used. The step is done when the registration record shows the exact redirect URIs and authentication method, and a test request with an unlisted redirect URI is refused.

  4. Request only the scopes the use case needs

    The application owner lists each FHIR resource type and operation the application must read or write, then maps each one to a granular scope and removes any broader scope that was requested for convenience. Patient-level and system-level scopes are separate decisions, and system-level access should be justified in writing. The step is done when the requested scope list matches the documented use case line by line and the reviewer has confirmed each scope against a data-access justification.

  5. Test the authorization and token exchange

    Using a non-production patient set, the team runs the authorization request, completes consent, and exchanges the code for a token, with PKCE verification for public clients. Decode or inspect the issued token to confirm the granted scopes match the approved list. The step is done when a token carries the expected scopes, and a request for a resource outside those scopes returns an authorization error rather than data.

  6. Test the boundaries and failure paths

    The team attempts out-of-scope reads, expired or reused authorization codes, a missing PKCE verifier for a public client, and a client assertion signed with the wrong key. Each attempt should be refused and logged. The step is done when every negative case returns an error, the refusals appear in the OpenEMR and web server logs, and the results are saved with the test evidence.

  7. Record the approval and set the review date

    The data owner or privacy officer approves the client, its scopes and its patient population in writing, and the record is stored with the registration details, client type, authentication method, scope list and test evidence. Confirm with your compliance lead how often approvals will be reviewed, since no review interval is set by the product. The step is done when the approval record exists, the registration matches it, and the client appears in the inventory used for the periodic audit described later in this page.

Which FHIR scopes map to which data an app can read

This table maps the scope types OpenEMR uses (patient, user and system; read and write) to the US Core 8.0 resources a typical app needs, with a justification and a review owner for each. Confirm every exact scope string and the resources it unlocks in the FHIR README before publishing, because scope names are the control point that decides what an app can read.

Scope familyTypical resources it unlocksBusiness justification to recordReview owner
Patient read (patient/Patient.read, patient/Observation.read)Patient, Observation, Encounter, Condition, AllergyIntolerance when the app is launched in patient contextApp needs chart data for one patient at a time, such as a clinical decision aid shown during a visitClinical informatics lead with privacy office sign-off
Patient read (patient/MedicationRequest.read)MedicationRequest, MedicationStatementMedication reconciliation or refill tools; justify each resource separately rather than bundling it with demographicsPharmacy or clinical safety owner
User read scopes (user/*.read)Resources the signed-in clinician can already view in the EHR, limited by OpenEMR's own access controlUse only for apps that act as the clinician inside the EHR; confirm that user permissions in OpenEMR are narrowed before approvalSecurity engineering with the EHR administrator
System read scopes (system/*.read)Bulk export across patients for analytics or migration, typically Patient, Observation, EncounterBackend jobs without a user session; tie each scope to a named service account and a documented data flowData governance owner and privacy officer
Write scopes (patient/*.write or user/*.write)Resources an app may create or update, such as Observation or Encounter entriesOnly where the workflow requires writes to the chart; confirm audit logging and validation for each written resourceClinical owner plus compliance reviewer
OpenID Connect identity scopes (openid, fhirUser, profile)No clinical resources; identifies the user and links to a FHIR user resourceNeeded for sign-in and user context; confirm the claims returned match what the app is allowed to storeIdentity and access management team

Hardening client registration and token trust

Every registered client is a path into OpenEMR patient data, so each control below narrows who can register, where tokens can be sent and how much data each token can reach. The cards work together: a tight registration process means little if redirect URIs are loose, scopes are broad or the FHIR endpoint is reachable from anywhere.

Restrict redirect URIs to exact values

A redirect URI tells the authorization server where to send the authorization code or token. If the registered value uses wildcards or loose path matching, an attacker who controls a similar address can receive codes meant for a legitimate app. For each client, register the exact callback URLs and no others, and review them whenever an app changes hosting or domain. Confirm how your OpenEMR version matches redirect URIs during registration and authorization, since matching rules are a detail to verify in your own environment.

FHIR README

Prefer asymmetric client authentication

Shared client secrets can be copied from a configuration file, a repository or a support ticket, and they grant access to anyone who holds them. Where OpenEMR's OAuth2 configuration supports JWKS-based client authentication, register the client's public key and have the app sign its token requests with the private key that never leaves its own system. Confirm with your OpenEMR version which client authentication methods are enabled, and retire shared secrets that are no longer needed.

Grant the least scope set per app

A scope list is the upper limit of what an app can read or write for the life of its tokens. Requesting broad patient, encounter or document scopes because they are convenient turns a narrow scheduling or patient-facing tool into a bulk reader of the chart. For each client, list only the resource types its workflow uses, separate read from write, and check the granted scopes against the approved request during review. Confirm the scope names your version supports against the FHIR README.

Separate system export clients from user apps

A backend system client that runs bulk exports has no user in the loop, so a compromise of its credentials exposes the population data without any clinician session to review. Keep system-level clients distinct from SMART apps that launch for a user, give each its own registration, credentials and owner, and never reuse one client for both purposes. Limit the system client to the export scopes it needs and the group or system level it actually uses.

Keep the FHIR endpoint behind TLS

Tokens and patient data travel with every FHIR request, so an unencrypted or broadly exposed endpoint lets anyone on the path capture them. Serve OpenEMR only over HTTPS, expose only port 443 where your design allows, and route FHIR traffic through approved network paths such as a reverse proxy, VPN or private integration network. Test the capability statement and token endpoints from outside the approved paths to confirm that unapproved sources are refused.

Harden administrators who approve clients

Whoever approves a client decides which application receives patient data, so an administrator account is a high-value target. Apply the Securing OpenEMR guidance: require HTTPS only, remove setup.php and other admin scripts after installation, and enable multi-factor authentication for every account that can register, approve or change clients. Keep approval rights to a small named group and log each approval so that a later review can trace who granted what.

Securing OpenEMR guide

Why client registrations and token requests fail

This table lists the failures teams most often hit when registering OpenEMR OAuth2 clients and requesting FHIR tokens, with the likely cause and fix for each. Read it as a triage sheet: match the symptom you see, check the cause column, then confirm the fix against the FHIR README and the logs of the OpenEMR version you run.

FailureLikely causeFix to verify
Redirect URI mismatchThe redirect URI in the authorization request does not exactly match a URI registered for the client, including scheme, host, port, path and trailing slash.Register the exact callback URL for each environment, then compare it byte for byte with the app configuration. Confirm the matching rules in the FHIR README for your version.
PKCE challenge missing for a public clientThe app is registered as public but sends no code challenge, or the token request omits the code verifier that matches it.Make the app send a S256 code challenge on authorization and the original verifier on token exchange. Check the FHIR README for the PKCE requirement for public apps.
JWKS key does not match the client's signing keyThe public key published at the client's JWKS endpoint, or uploaded at registration, is not the key used to sign the client assertion, or the key ID (kid) differs.Publish the public half of the active signing key, confirm the kid in the assertion header matches, and rotate keys in a planned window. Check the token endpoint error in the logs for the rejected key.
Requested scope not granted to the clientThe scope in the request is not among those approved for the registered client, or the scope name is misspelled or uses an unsupported form.Request only scopes approved for that client, review the granted list after approval, and correct scope strings against the granular scopes listed in the FHIR README.
Token issued but resource request returns an authorization errorThe token lacks the scope needed for the resource, the patient or user context does not allow the read, or the request targets a resource type outside the granted scopes.Decode the scopes on the token, compare them with the resource and operation called, and check the access log entry for the denied request. Confirm behavior against the running version.
FHIR API disabled on the chosen siteIn a multisite install, the FHIR API or its OAuth2 settings are enabled on one site but not the site named in the token request or base URL.Enable the FHIR API and OAuth2 settings on the specific site, then request the capability statement from that site's base URL. Verify the site setting steps in the FHIR README and the logs of the running version.

How to audit registered clients after go-live

Client registration is not a one-time decision. Every registered application needs a recurring review of its granted scopes, named owner, signing keys, redirect URIs and whether the business still needs it. Start by exporting the current client list from OpenEMR's OAuth2 client administration and comparing each entry against the approval record your team kept at registration. Any client that cannot be matched to an approved request, an owner and a current use case should be treated as an exception to resolve, not as background noise. Confirm in your own OpenEMR version how the client list and client details are exposed, since the admin screens and any export options can differ across releases.

Next, remove dormant clients and tighten what remains. A client with no recent token activity, or whose owner has left, is a candidate for disabling and then deletion once the app team confirms it is not needed. Check that each remaining client still requests only the FHIR scopes it needs, that redirect URIs match the production hostnames and that confidential clients authenticate with the JWKS keys you expect. Rotate client keys on a schedule your organization sets, record each rotation with a date and approver, and confirm how the old key is retired. Retain the exported list, the comparison, removal tickets and rotation records as evidence for your HIPAA risk assessment work under the Security Rule, which requires periodic review of security measures, but understand that this evidence supports your own analysis. It does not produce an audit report, attestation or certification, and HHS states that there is no HIPAA certification.

Fold patching into the same cycle. OpenEMR's 8.3.0 and 8.4.0 releases fixed security vulnerabilities in FHIR APIs, so each review should confirm the running version against the OpenEMR releases page and record whether any security release affecting the API has been applied. Schedule the review for after each security release, not only on a calendar, and confirm with your OpenEMR support provider or the project how a given patch applies to your deployment.

Questions buyers ask about OpenEMR client registration and scopes

How much effort does OpenEMR client registration and scope setup take?

The effort depends on how many applications connect, which client types they use, how many scopes each one needs, and how much review each request gets. A single internal app with one confidential client and a short scope list is a small task. A portfolio of SMART on FHIR apps, some public clients using PKCE, and a formal scope review process is a larger one. Identity integration adds work when sign-in must go through your existing provider rather than local accounts. Ask any partner to break its quote down by these drivers, and ask which items recur, such as periodic client audits.

How long does it take to set up OpenEMR OAuth2 clients and scopes?

Duration follows the same drivers as effort: the number of applications, the review cycle for each scope request, and whether test patients and a non-production server are ready. Most of the elapsed time is usually waiting on app owners and approvers, not configuration itself. Confirm with your team how long approval decisions take, because that often sets the schedule. No fixed duration applies to every environment, so ask for a timeline in the written scope, with each approval and test step listed as a dependency.

What does our internal team need to provide for this work?

Your team needs to supply several things before configuration begins:

  • Named app owners who can describe what each application does and what data it needs
  • An approval authority, such as a privacy or clinical informatics lead, who can accept or reject each scope request
  • Test patients in a non-production OpenEMR site, so scopes can be checked without real PHI
  • Administrative access to the OpenEMR server and its FHIR settings, plus a way to review the registered client list

Without these, the work stalls at the first approval.

Can our team set up OpenEMR OAuth2 clients on its own?

Yes, a capable internal team can do this without an outside partner, provided it works from the OpenEMR FHIR README and tests in a non-production environment first. The hard parts are less about configuration and more about decisions: which client type fits each app, which scopes are justified, and who signs off. Teams that lack an OAuth2 or FHIR background, or that must document the decisions for an assessor, often find a short review useful. Start by reading the FHIR README and confirming the behavior of your OpenEMR version in a test site.

What changes after an OpenEMR version upgrade?

An upgrade can change FHIR API behavior, scope handling and security settings, so registered clients should be retested after each upgrade rather than assumed to work. Recent releases have included security fixes in the FHIR API, and the 8.x line has its own PHP and database requirements. Plan a regression pass for every registered client, check that scopes still map to the resources you intended, and review the client list for anything no longer in use. Confirm the exact changes in the release notes for your target version before scheduling the upgrade.

How do DeployOpen's fixed-scope engagements and retainers apply here?

DeployOpen typically works under a fixed scope, with deliverables and timelines agreed in writing before work starts, so you know what is included before you commit. The written scope would list the applications to register, the client types and scopes to configure, the review and test steps, and the handover. Ongoing work such as re-reviewing scopes after upgrades, retesting clients and periodic client audits can be covered by a retainer. DeployOpen does not publish a price list, so ask for a quote built from your written scope.

Does DeployOpen issue audit reports or certifications for our OpenEMR setup?

No. DeployOpen prepares systems, controls and evidence for compliance assessments, including documented client registrations, scope decisions and test results. It does not issue audit reports, attestations or certifications. Independent auditors and certification bodies perform those assessments. HIPAA has no certification, so ask any vendor who claims otherwise to show the basis for the claim. Confirm with your assessor which evidence they expect for client registration and scope review.

How DeployOpen scopes, delivers and supports OpenEMR client registration

DeployOpen plans, builds, documents and supports the OpenEMR OAuth2 client registration and FHIR scope model inside your own infrastructure. We start from the list of applications that need OpenEMR data, then agree in writing which clients are registered, which launch and authentication methods they use, and which scopes each one receives.

How we scope

  • We inventory every application that will request OpenEMR data, including its launch type and client type.
  • The written scope lists the clients, granted FHIR scopes, PKCE and JWKS decisions, and the sites in view.
  • We confirm with you which registration and approval steps stay with your administrators after handover.
  • Engagements are fixed-scope, so deliverables and timelines are agreed in writing before work starts.

How we build

  • We configure OpenEMR's OAuth2 settings and registration workflow in a staging environment that matches production.
  • Confidential clients are set up with JWKS-based client authentication, and public clients are set up with PKCE.
  • Each client receives only the granular scopes its use case needs, and we test that broader requests are refused.
  • We document each registered client, its scopes and its owner in a register your team can review.

How we hand over

  • You receive the client register, scope mapping, configuration records and test results for each registered application.
  • Your administrators receive a walkthrough of how to approve, change, rotate and retire a client.
  • We provide a checklist for auditing registered clients on a schedule your team sets, using the audit records OpenEMR keeps.
  • Retest results are included so you can see which scope and authentication checks passed before go-live.

How we support

  • Ongoing support, upgrades and continuous testing are available as retainers, so client changes can be reviewed as they happen.
  • When OpenEMR releases affect the FHIR API or authorization behavior, we review the change against your client register.
  • Support covers adding new applications through the same scope review, rather than granting broad access by default.
  • Ask any partner, including DeployOpen, to confirm OpenEMR version-specific behavior against the release notes for your version.

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.