Microsoft Entra ID SSO for Medplum

How to sign providers and patients in to Medplum with Microsoft Entra ID, including app registration, OIDC settings, per-client versus domain-level providers, user matching and conditional access.

On this page

Why teams connect Microsoft Entra ID to Medplum

A healthcare organization that already runs Microsoft Entra ID can let staff and patients sign in to Medplum with their existing directory accounts instead of a separate Medplum password. Medplum Auth, which provides OAuth, OpenID Connect and SMART-on-FHIR, can accept an external OpenID Connect provider such as Entra ID, so the sign-in step moves to Entra while Medplum still issues the tokens its APIs check. The main decision is whether one Entra app registration serves a single Medplum project or the whole email domain, because that choice determines who is forced through Entra and how much configuration you maintain.

Basic external SSO fits a limited group, such as one clinic's staff or a pilot population. A corporate identity provider configured at the domain level fits the case where every user with an address on your domain must authenticate through Entra, and where you want new hires and leavers handled by your directory rather than by Medplum administrators. Confirm in Medplum's authentication documentation which of these options your plan and deployment include, since multiple external providers for SSO are listed as an enterprise feature on the pricing page.

Multi-factor authentication for SSO users comes from Entra, not from Medplum. Medplum's own MFA applies only to password logins, so the Conditional Access policies you set in Entra decide whether a sign-in needs a second factor, a compliant device or a sign-in from a trusted location. Before rollout, confirm those policies with the security team and test them against both staff and patient accounts, because a patient-facing app may need different rules than a clinician portal.

Per-client versus domain-level Entra ID provider options

This table compares a per-client Entra ID provider on one ClientApplication with a domain-level provider that applies to everyone on an email domain. Read each row against your mix of patient and staff users, since the scope decision shapes project setup, admin work and how users are matched. The main takeaway is that the scope choice should follow your audiences, and that multiple external providers are an enterprise feature on Medplum's pricing page.

Decision factorPer-client providerDomain-level provider
Best fitOne app with its own sign-in, such as a patient portal registered to a specific Entra appStaff on one corporate email domain who sign in to several Medplum apps
Audience mixPatients or external users who may not share your Entra tenant or email domainEmployees of one organization whose accounts all live in the same Entra tenant
Configuration locationOn the ClientApplication that the app uses for sign-inApplied to the email domain, so every matching user is routed to Entra
Effect on project adminEach app needs its own Entra settings and callback URL, so more setup per applicationOne set of Entra settings covers the domain, but changes affect all users on it
Matching by emailConfirm whether your app matches on the email claim and how it handles changed or aliased addressesEmail domain drives routing, so confirm which domains are claimed and how guest accounts are treated
Matching by subjectSubject (sub) is stable per Entra app registration, so confirm it is used when emails can changeConfirm subject-based linking is configured before users are migrated from other providers
Multiple providersListed as an enterprise feature on Medplum's pricing page, so confirm your plan covers itListed as an enterprise feature on Medplum's pricing page, so confirm your plan covers it
Testing and rolloutPilot one client first, then extend the pattern to other ClientApplicationsTest with a small group of accounts before enforcing the domain for all staff

How to register the Entra ID app and configure Medplum

This sequence connects a Microsoft Entra ID app registration to your self-hosted Medplum deployment so staff and patients can sign in through Entra ID, with user matching set and both account types tested before rollout.

  1. Register the application in Entra ID

    An Entra ID administrator with rights to create app registrations creates a new registration in the tenant that holds your staff accounts. Choose a name your administrators will recognize, select the account types that should be able to sign in, and record the directory (tenant) ID and application (client) ID shown on the overview page. Check that the registration appears in the tenant you intended before moving on, since a registration in the wrong tenant will reject the users you need.

  2. Set the Medplum callback as redirect URI

    In the registration's authentication settings, add a web redirect URI that matches the callback path for your deployment. Take the exact value from your self-hosted server's configuration and the Medplum authentication documentation, not from a template, because a single character difference will cause sign-in to fail. Confirm the saved URI matches the one Medplum expects, character for character, including protocol, host, port and path.

  3. Collect the client ID and client secret

    Under certificates and secrets, create a client secret and copy its value immediately, because Entra ID will not show it again after you leave the page. Note the expiry date Entra ID assigns to the secret and record it in your renewal calendar, since an expired secret stops sign-in without warning. Store the secret in your organization's secrets manager and confirm the client ID and tenant ID are recorded alongside it.

  4. Configure the OIDC identity provider in Medplum

    A Medplum administrator adds an OpenID Connect identity provider using the issuer, client ID and client secret from the previous steps. Confirm the discovery endpoint and scopes against the Medplum authentication documentation for your version, and decide whether the provider is set per client application or at the domain level, since that choice determines which users and apps it covers. Save the configuration and confirm the provider appears as an option on the sign-in page for the intended project.

  5. Set the user matching rule

    Decide whether Medplum matches an incoming Entra ID identity to an existing user by email address or by subject identifier, and apply that rule in the provider settings. Email matching is easier to set up for new deployments but depends on the email attribute being trusted and unchanged, while subject matching is more stable when addresses change. Test with one existing user to confirm the login links to the correct Medplum account rather than creating a duplicate.

  6. Test sign-in with a staff account

    Sign in with a staff account from your Entra ID tenant through the Medplum login page and confirm the user lands in the expected project with the correct access policy applied. Check that the Medplum user record matches the intended person and that any conditional access requirements you set on the Entra side, such as MFA prompts, are enforced. Record the result and any error messages, and repeat the test for a second staff account with a different role.

  7. Test sign-in with a patient account

    Sign in with a patient account through the sign-in path your deployment uses for patients, which may differ from the staff path, and confirm the patient reaches only the records and screens their access policy allows. Confirm which identity provider the patient account uses and whether it sits in the same Entra ID tenant, since patient identities are often held elsewhere. Document the result before you open access to real users, and confirm the exact patient flow against the Medplum authentication documentation for your version.

How the Entra ID login flow reaches Medplum

The flow starts in the user's browser, which opens the Medplum sign-in page and is redirected to the Microsoft Entra ID authorization endpoint in the client's tenant. Entra ID returns an authorization code through the browser, and Medplum Auth exchanges it for tokens and reads the user's identity claims. Medplum then matches that identity to a user, either by email or by subject, and issues its own session to the Medplum app. Check the matching setting first, because it decides whether an existing account is reused or a new one is created.

Sign-in path from the browser through Entra ID to a Medplum session, with the tenant boundary marked.

Security controls to set on both sides

Entra ID decides who reaches the Medplum sign-in, and Medplum decides what a signed-in user can do. Both sides need controls, because a weak Entra policy or a loose matching rule lets the wrong account into a project that holds patient data. The cards below cover the Entra conditions, the client secret, account matching and the post-sign-in review of Medplum rights.

Conditional access for the Medplum app

Create a Conditional Access policy that targets the Entra enterprise application used for Medplum sign-in, not the whole tenant. Require multi-factor authentication, require a compliant or managed device where your organization has that standard, and restrict sign-in by location or named network ranges if your clinical staff work from known sites. Test the policy with a pilot group first, because a rule that blocks a clinician at the bedside will drive workarounds. Check that the policy also covers legacy sign-in paths your users might take.

Medplum auth docs

Rotating the client secret

The Entra app registration issues a client secret that Medplum stores to complete the OIDC code exchange. Set an expiry that matches your rotation policy, record the expiry date in your calendar and certificate inventory, and rotate by adding a new secret, updating Medplum, verifying sign-in, then deleting the old secret. Keep the value out of shared configuration files and restrict who can read the secret store. Confirm with Medplum how your deployment reads the value so a rotation does not cause a silent sign-in outage.

Limiting who can match

Decide which Entra users are allowed to reach Medplum at all. Use assignment on the enterprise application so only named groups or roles receive tokens, and keep the list aligned with your joiner and leaver process. Any user who can sign in to Entra and is assigned to the app can attempt to map to a Medplum profile, so an overly broad assignment group widens the attack surface even when the matching rule is correct.

Avoiding takeover through unverified email

Matching users by email is convenient, but it is only safe when the email claim is trusted and owned by your tenant. Match on the immutable subject identifier where your Medplum configuration supports it, and treat email as a display or lookup value. If you must match on email, confirm that every address in scope is a verified domain you control and that external guest accounts cannot present a matching address. An unverified or self-asserted email claim is a route to account takeover.

Reviewing project admin rights after sign-in

Signing in does not settle what a user can do. After the first sign-in, review the Medplum ProjectMembership for each federated user, check whether any account has project admin rights, and confirm which access policy applies. Federated users should receive least-privilege roles, and admin rights should stay with a small named group. Repeat the review on a schedule and after every change to Entra groups, because a group that was granted admin in Entra can carry that access into Medplum.

Questions teams ask before connecting Entra ID

How much effort does connecting Microsoft Entra ID to Medplum take?

The effort depends mostly on how many identity providers you connect, who signs in (staff, patients or both), and how much conditional access design sits on the Entra side. A single staff provider with one client application is a small, bounded task. Each additional provider, each audience with different login rules, and each conditional access policy that must be tested adds configuration and verification work. Medplum's authentication docs describe the supported provider types, and the write-up of the setup steps is the best place to see which decisions apply to your case. Ask any partner to break the quote down by provider, audience and Entra policy set.

What drives the cost of an Entra ID SSO setup?

Cost is driven by who does the work and how many decisions are involved. Your own tenant administrator's time, your Medplum administrator's time, and any partner's fixed-scope fee are the main components. Costs rise with the number of providers, the use of per-client versus domain-level providers, the complexity of user matching by email or subject, and the number of conditional access rules that need testing. Recurring costs include Medplum hosting or self-hosting infrastructure, your Entra licensing, and any retainer for upgrades and support. Ask for a quote that lists one-time configuration separately from recurring operations.

What does the client need to supply for Entra ID SSO?

You need three things before work starts. First, a Microsoft Entra ID tenant administrator who can create or approve an app registration and grant or confirm the redirect URI and client settings. Second, rights to register applications in the tenant, or a named person who will do it under your change process. Third, a Medplum administrator with access to the project or server settings where the identity provider is configured. If you run self-hosted Medplum, you also need access to the server environment to confirm the callback URL and any super admin setup. Agree on who approves conditional access changes before the first test sign-in.

Can our own team connect Entra ID to Medplum without a partner?

Yes, a team with Entra administration skills and Medplum administration access can usually complete a basic staff sign-in setup. The harder parts are design decisions: whether a provider is set per client or at the domain level, how users are matched (by email or by subject identifier), how patients are separated from staff, and how conditional access interacts with Medplum sessions. Your team should check these choices against Medplum's authentication documentation and test with accounts that mirror real roles. A partner is most useful when the design spans several providers, a regulated audience, or a self-hosted deployment that must be reviewed by your compliance team.

How long does Entra ID SSO setup usually take?

Duration depends on scope and on approval cycles inside your organization. A single staff provider with a documented app registration and a short test plan is typically much shorter than a design that covers patients, multiple providers and conditional access rules. Most delays come from tenant approval, change windows and test account creation, not from the Medplum configuration itself. Ask for a timeline that separates design, configuration, testing and go-live approval, and confirm which steps depend on your Entra administrators. DeployOpen does not publish a fixed duration; the agreed written scope sets the schedule.

Does the setup change if we move from Medplum Cloud to self-hosting?

Yes, the Entra side stays largely the same, but the Medplum side changes. On self-hosted Medplum you own the server URL, the callback configuration and the super admin setup, so those settings must be confirmed in your environment after each move. Compliance also shifts: Medplum's compliance documentation describes compliance as a shared responsibility between Medplum and its customers, so self-hosting adds controls you run yourself. Plan to re-test sign-in, user matching and conditional access after any hosting change, and check the upgrade path in Medplum's self-hosting documentation before you change platforms.

What breaks most often in Entra ID sign-in for Medplum?

The most common failures are a redirect URI that does not exactly match the value registered in Entra, a user whose email or subject does not match the stored identity, and a conditional access policy that blocks or challenges sign-in unexpectedly. Other issues include users with multiple Entra accounts, test accounts that are excluded from policies, and mismatched client settings after an environment change. Check each item against your configuration, sign in with a test account for each role, and keep a record of which Entra policies apply to which Medplum client so that a later policy change does not break access without warning.

What to confirm in your environment

The Entra ID setup depends on facts that change between Medplum releases, plans and tenants. Treat the items below as checks to run against your own deployment and your own Microsoft tenant, not as settled answers.

Medplum version in production

Confirm the exact Medplum server version your deployment runs before you copy any OIDC setting from documentation. Authentication behavior and admin screens change between releases, and self-hosted upgrades must pass through each minor version in sequence. Compare the running version against the release notes and the upgrade guide, and record the version in your change ticket so the Entra configuration can be checked again after the next upgrade.

Versions and release policy

Current OIDC and provider settings

Read the current authentication documentation for the exact redirect URI, provider fields, scopes and token settings your version expects. Do not rely on screenshots or forum posts from older releases. Write down each field you set in the Entra app registration and in Medplum, so a reviewer can match the two sides without reverse engineering them.

Medplum authentication docs

Multiple external providers on your plan

Ask Medplum whether your plan allows more than one external identity provider. The pricing page lists multiple external providers such as Okta, Azure and Auth0 as an enterprise feature, so a per-client Entra setup alongside another provider may require a plan change. Confirm this in writing before you design around a second provider, and confirm whether your deployment type changes the answer.

Medplum pricing

Entra ID license tier for conditional access

Conditional access policies in Microsoft Entra ID are tied to specific license tiers and tenant configurations. Confirm with your Microsoft account team or licensing administrator which tier includes the policy types you plan to use, such as device compliance, location or sign-in risk checks. Also confirm whether the tenant can apply these policies to a single enterprise application without affecting other apps.

Patient account creation and matching

Decide how patient accounts are created in Medplum and how each sign-in is matched to an existing user. Matching by email is simple but depends on the email claim being stable and verified in your tenant, while matching by subject ties the account to the Entra identifier. Test with a patient account and a staff account, and confirm which path creates duplicates when an email address changes.

Matching users by email or subject

The matching rule decides which Medplum user record a successful Entra sign-in attaches to, and it is the single setting that most affects duplicate accounts and offboarding. Matching by email address is simple to explain and matches how staff already think about their identity, but the email claim can change when someone marries, changes role, or is renamed, and a shared or alias mailbox can route one address to several people. Matching by the stable subject identifier (the sub claim from the Entra ID token) survives those changes because it does not depend on a human-readable attribute. The trade-off is that subject values are opaque, so the first sign-in creates a link that someone must trust and that is harder to read during an audit.

Before go-live, decide the rule per Medplum project or client and write down what happens when a record already exists under the other attribute. Test it with at least one account that has a changed email, one alias address, and one user who has previously signed in with a Medplum-native password. Confirm in your own environment which claims the Entra app registration returns, whether the Medplum configuration you use matches on email or subject, and how a second identity linked to the same person is handled. Check that a disabled Entra user cannot create a fresh Medplum session through an existing link, because offboarding depends on that result. Record the test outcomes as part of the change record, since the choice drives both account duplication and the process you follow when an employee leaves.

What the engagement typically covers

A DeployOpen engagement for Entra sign-in to Medplum is scoped in writing before work starts, so the boundaries are clear to both sides. The cards below follow the order most projects take, from the Entra application through to the handover your team runs after go-live.

Entra app registration review

We review the app registration your tenant already has, or the one we propose, against what Medplum needs: the redirect URI for your Medplum deployment, the supported account types, the client secret or certificate in use, and which API permissions are granted. Overly broad permissions and stale secrets are common findings. The review also confirms who in your tenant can change the registration, since that person can redirect sign-ins.

Medplum auth docs

Medplum identity provider configuration

We configure the OIDC settings in Medplum, either as a per-client provider for one application or as a domain-level provider for everyone on your email domain, and document which choice was made and why. The work covers issuer and endpoint values, scopes, and the callback addresses for each environment, including staging and production. Each setting is recorded so a later change can be traced.

Medplum auth docs

User matching design

We design how an Entra sign-in is matched to an existing Medplum user, by email address or by the subject identifier Entra issues. Email matching is simpler to operate but depends on mailboxes staying stable. Subject matching survives address changes but needs a one-time mapping for existing accounts. The decision is written down with the handling for renamed, duplicate and departed users.

Conditional access review

Conditional access policies in Entra decide whether a sign-in reaches Medplum at all, so we review which policies apply to the Medplum application, including multi-factor requirements, device compliance, location rules and sign-in risk. We check that the policies match your access policy in Medplum and that no policy exempts the accounts that need access. Changes to Entra policies are your decision, and we document what we recommend.

Test plan and handover

We run a written test plan covering first sign-in, matching for existing and new users, denied access, sign-out and the behavior of conditional access prompts. Results are recorded and failed cases are retested after fixes. The handover package includes configuration records, the matching design, runbooks for adding a provider or rotating a client secret, and the ownership of each Entra setting after the project closes.

How DeployOpen scopes and supports Medplum SSO

DeployOpen plans, implements, documents and supports self-hosted open-source platforms inside the client's own infrastructure, including Medplum sign-in. For Microsoft Entra ID SSO, the work starts with a written scope that fixes which app registrations, providers and conditional access rules are in place before any configuration begins.

How we scope

  • Written scope covers which Entra tenants, app registrations and Medplum projects are in place
  • Scope records whether each client uses a per-client provider or a domain-level provider
  • Scope names the user matching rule, email or subject, and who approves that choice
  • Scope lists the conditional access policies on the Entra side that Medplum sign-in must honor

How we build

  • Configure the Entra app registration, redirect URIs and OIDC settings in a non-production Medplum environment first
  • Test email and subject matching with real staff, guest and test accounts before any rollout
  • Verify that Entra conditional access and MFA are enforced on Medplum sign-in paths
  • Check that self-hosted Medplum admin access works if the identity provider is unavailable

How we hand over

  • Deliver configuration records, provider settings and client secret locations for your review
  • Provide a test script that shows successful, denied and unmatched sign-in outcomes
  • Document the runbook for adding users, rotating secrets and changing provider settings
  • Deliver a findings report with fixes and a retest once changes are complete

How we support

  • Ongoing support, upgrades and continuous testing are available as retainers
  • Retainers can cover re-checking SSO settings after each Medplum minor or patch upgrade
  • Support can include reviewing Entra conditional access changes before they reach production
  • Ask any partner to confirm response scope, hours and escalation paths in the written quote

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.