Why SMART Backend Services and JWT client assertion matter for Medplum integrations
This section explains why a system integration that calls a self-hosted Medplum server with a shared client secret should move to signed JWT client assertion, and when that move is worth planning now. The short answer is that a shared secret is a credential both sides must store and transmit, so any copy of it can be used to call Medplum as that integration. Replacing it with a private key that never leaves the integration means Medplum only ever holds the public half, and the integration proves its identity by signing a short-lived assertion each time it requests a token.
Medplum Auth documents OAuth, OpenID Connect, SMART-on-FHIR and client credentials for server-to-server access, and its authentication docs describe the client authentication options for ClientApplication and machine access. Basic client credentials are often enough for an internal job that runs inside one trusted network and is owned by one team. The signed JWT setup earns its extra work when the integration crosses an organizational boundary, when a partner or payer requires it, or when your security team wants secrets rotated without redeploying every caller. Confirm the exact client authentication methods available in the Medplum authentication docs for your server version before you design around any of them.
The decision to make first is whether your integration is a backend service with no user present, since that is the case SMART Backend Services is built for. Inventory every system that holds a Medplum client secret, note who can read it, and record which ones a partner's specification or contract already asks you to change. Those answers determine the key ownership model, the rotation schedule and the order of the cutover, and they should be agreed before any key pair is generated.
How a signed JWT client assertion reaches the Medplum token endpoint
The integration signs a short-lived assertion with its private key and posts it to the Medplum token endpoint. Medplum checks the signature against the public key published in the JWKS endpoint registered for the client, then issues an access token. The key store on the client side and the Medplum server are separate trust zones, so the private key never leaves the client. Confirm in your own deployment which JWKS URL Medplum reads, how it caches keys, and what happens when a key is rotated.
The private key stays in the client's key store; Medplum only verifies signatures against the published public key.
Which authentication option fits which integration
When you own both the calling service and the Medplum project, a shared client secret is the simplest option and often the first one teams implement. The secret is created on a ClientApplication, stored in your secrets manager, and sent during the token request. Because you control both ends, the main risk is secret sprawl: the same value copied into CI variables, configuration files and developer laptops. Moving to a signed JWT client assertion keeps the private key inside the service and means Medplum only ever holds the public key, which makes ownership clearer when a service is retired or rebuilt.
- Secret handling: A client secret is one value that both sides must hold. Anyone who reads it can request tokens as that client until it is rotated.
- Key ownership: With assertion, your team generates the key pair and keeps the private half. Medplum receives only the public material.
- Rotation effort: Rotating a secret means updating every consumer at once. Rotating an assertion key means publishing the new public key, deploying the signing change, then retiring the old key.
- Operating needs: Assertion requires a key storage location, a signing step in the client, and a way to publish or register the public key.
- Scope of change: Confirm with the Medplum docs for your version how a ClientApplication accepts a registered key before choosing this path.
Before you choose, check who else has access to the current secret and whether your secrets manager can hold a private key with the access controls you need.
Third-party systems such as a vendor's scheduling tool, a reporting product or a hosted integration engine usually receive a credential that you issue to them. Here the question is less about code and more about how the vendor stores and rotates what you give them. A shared client secret is easy for the vendor to configure but places the full credential in their systems, where your team has limited visibility. A signed JWT assertion lets the vendor keep the private key on their side while you register only the public key, so a breach of your Medplum configuration does not expose a signing credential.
- Vendor capability: Ask whether the vendor can generate and sign a JWT with a configurable algorithm and key ID. Many products cannot.
- Key registration: Agree on who uploads the public key, how it is delivered, and who approves changes.
- Rotation coordination: Build a window in which the old and new public keys are both accepted, then retire the old one.
- Revocation: Know how you disable a single client without affecting other integrations.
- Documentation: Record which Medplum ClientApplication and access policy each vendor uses.
Confirm supported algorithms in the Medplum docs for your version and check the vendor's own signing options in writing before the contract is signed.
Payer and trading partner connections are where the choice is often set by the other party, not by you. Some payers and specifications expect asymmetric client authentication and will not accept a shared secret. Others accept multiple methods and let you choose. Before designing the integration, collect the exact requirements from each counterparty in writing, including the signing algorithm, key format, how public keys are exchanged, and whether they also require mutual TLS. Treat these requirements as fixed inputs and plan the Medplum side around them.
- Counterparty requirements: Obtain the authentication requirements from each payer or specification version your integration must meet.
- Key exchange: Confirm how the partner receives your public key, how they receive key updates, and the lead time they need.
- Layered controls: Some connections combine assertion with mutual TLS. Plan each layer and its certificate lifecycle separately.
- Ownership and audit: Record which party owns each key, who can rotate it, and where rotation events are logged.
- Testing: Agree on a sandbox or test environment where keys can be exchanged and verified before production.
Ask each counterparty to confirm the exact method, algorithm and key format in writing, because requirements can differ between partners using the same specification.
How to set up key pairs and a JWKS endpoint for Medplum
This sequence replaces a shared client secret with a signed JWT that your integration uses to get Medplum access tokens. Each step ends with a check, so a fault is caught where it was introduced. Confirm the exact algorithms and client settings against the Medplum authentication docs for your server version before you start.
Generate the key pair in a managed store
The platform or security team generates an asymmetric key pair in a key store the organization controls, such as a cloud key management service, a hardware security module or a self-hosted OpenBao instance. Where the store allows it, keep the private key non-exportable so it cannot be copied out. Assign the key a stable key ID (kid) and record which environment it belongs to. Done means a test payload signed with the private key verifies with the public key, and the private key does not appear in source control, CI variables or the integration's configuration files.
Choose a signing algorithm Medplum accepts
Confirm the supported signing algorithms in the Medplum authentication documentation for your server version, then select a key type that matches one of them. Key type and algorithm must agree, so an RSA key cannot be used with an elliptic curve algorithm, and a mismatch will fail at the token call. Record the algorithm, key type, key size and kid in the integration's design record. Done means a locally generated assertion decodes with the alg header you expect and the key type you recorded.
Publish the public key as a JWKS
Build a JSON Web Key Set that contains only the public key, with its kid, key type, algorithm and use fields, and serve it over HTTPS at a stable URL on a host you control. The document must never include private parameters. Confirm the URL is reachable from the network where the Medplum server runs, since firewall or private network rules often block it, and test from there rather than from a workstation. Done means the response from the Medplum server's network shows exactly one key with the kid you generated and no private fields.
Register the client with the matching key reference
Create or update the ClientApplication for the integration in Medplum and point its client authentication settings at the JWKS URL, so Medplum fetches the public key to verify assertions. Confirm the exact configuration fields in the current Medplum docs, because names can change between versions. Assign an access policy that limits what this client can read and write. Done means the client record shows the JWKS URL, the access policy and a client ID that matches what the integration will send.
Request a token with a signed assertion
The integration builds a JWT with the client ID as issuer and subject, the token endpoint as audience, a short expiry and a unique identifier (jti). It signs the JWT with the private key and posts it to the token endpoint with the client credentials grant and the JWT bearer client assertion type. Confirm with Medplum whether the server enforces jti uniqueness and what maximum assertion lifetime it accepts. Done means the token endpoint returns a success response with an access token, and the integration logs the kid it used.
Verify the access token against the policy
Using the access token, call one read and one write endpoint that the access policy should allow, then call one resource it should deny. Compare each result with the policy written in the registration step. Decode the access token's claims and confirm the client identity matches the ClientApplication. Done means the allowed calls succeed, the denied call returns an authorization failure, and the results are saved as the baseline test for later changes.
Rotate keys with an overlap window
Before the first key needs replacing, generate a second key pair in the same store and add its public key to the JWKS so both keys are published. Switch the integration to sign with the new kid, then run the token call and access checks again. Only after the new key succeeds should the old public key be removed from the JWKS and its private key retired. Done means the token call succeeds with the new kid while both keys are still published, and the old kid is absent from the JWKS afterward.
How to rotate signing keys without breaking integrations
The safe way to rotate a signing key for a SMART Backend Services client is overlap rotation: publish the new public key alongside the old one, switch the client to sign assertions with the new private key, and retire the old key only after you have confirmed that nothing still uses it. Dropping the old key first, or replacing it in one step, is the change most likely to stop a live integration because the server can no longer verify tokens signed with the key it was using. Before you start, confirm with Medplum how the JWKS entries for a ClientApplication are stored and how the server selects a key when several are present, since that behavior is what makes the overlap work. Confirm this against the Medplum version you run, using the Medplum authentication docs and the release notes for your version, because key handling can change between releases.
Set the rotation schedule and ownership in your own key management policy, not in Medplum. Decide who generates the key pair, where the private key is held (for example, in your secrets manager or HSM-backed store), who approves a rotation, and how often rotation happens. Record the kid of every key so that each assertion can be traced to a key version in your logs. Run a rotation as a short checklist: add the new public key, deploy the client with the new kid and signing key, watch authentication logs until the old kid no longer appears, then remove the old public key. Keep the old private key available only until that check passes, then destroy it according to your policy.
Plan emergency revocation separately from scheduled rotation. If a private key may be exposed, remove the compromised public key from the client as soon as the replacement is in place, and expect some integrations to fail until their clients sign with the new key. Name the on-call owner who can do this, rehearse the steps on a non-production ClientApplication, and document which partners must be told. Illustrative example: a partner's scheduled job uses a key that was copied to a laptop, so the security team removes that key and the partner's job fails until it is reconfigured with a new key pair. The rehearsal should confirm that your team can complete that sequence within the window your incident process requires.
Security controls that matter for JWT client assertions
A signed JWT client assertion moves trust from a shared secret to a private key and a short-lived token request. The controls below cover where that key lives, how it is revoked, how assertions are protected from replay, what the client is allowed to do, and what is logged. Each one names what the client or partner must confirm before go-live.
Private key storage and access
The private key signs every assertion, so whoever holds it can impersonate the integration. Confirm where the key is generated, whether it is kept in a secrets manager or HSM-backed store, and which people and service accounts can read it. Keep the private key out of CI variables, container images and shared repositories, and record who has access. Only the public key should be uploaded to Medplum or published through a JWKS endpoint.
Key compromise and revocation
A leaked private key remains valid until its registered public key is removed or replaced. Agree in advance who can disable the key, how quickly that change is made, and how the partner is notified. Confirm that the client's configuration can drop a key ID from the JWKS without breaking other keys still in use. Test the revocation path on a non-production project so the steps are known before an incident.
Assertion lifetime and replay protection
Each assertion should carry a short expiry, a unique jti value and the correct audience for the token endpoint. Confirm that the authorization server rejects reused jti values within the validity window and rejects assertions that are expired or addressed to another audience. Ask the partner whether their signing library sets these claims. Token requests that fail these checks should be logged as failures, not silently retried.
Access policy scope on the client
A backend client should only reach the resources its integration needs. Confirm which ClientApplication holds the assertion key, which access policy is attached to it, and whether that policy limits resource types and compartments. Review the scopes the client requests during token exchange against the integration's written data flow. A service account with broad read access is a larger exposure than a leaked key with a narrow policy.
Medplum auth docsAudit logging of token requests
Token requests and the resource calls they authorize are the evidence that an integration behaved as agreed. Confirm that successful and failed assertion attempts are recorded with the client identity, time, source address and key ID, and that these logs are forwarded to a store your security team controls. Set a retention period that matches your contracts and compliance obligations. Review failed attempts regularly, since repeated failures can indicate a stolen or misconfigured key.
TLS and network controls on the token endpoint
On a self-hosted deployment, your team controls how the token endpoint is exposed. Confirm that it is served only over TLS with current certificates, that the load balancer or ingress does not strip or alter the request, and that network rules limit which sources can reach it where partners have fixed addresses. Check that the same controls apply in every environment. Server patches also matter here, and Medplum's policy targets security fixes within 7 days for critical vulnerabilities.
Medplum release policyQuestions teams ask before setting up JWT client assertion in Medplum
Can our team set up JWT client assertion in Medplum without an outside partner?
Yes, a team with experience in OAuth, key management and its own integration code can usually do the setup itself. The work is mostly configuration: generating key pairs, registering the public key with the client, signing short-lived assertions and exchanging them at the token endpoint. The harder part is operational, not technical: deciding who owns private keys, rotating them without outages and testing against each partner's sandbox. If none of your engineers has done this before, or your integrations are payer-facing, an outside review of the design often costs less than fixing a rushed first deployment. Confirm the exact client configuration steps against the current Medplum authentication documentation for your version.
What makes the effort grow for a JWT client assertion setup?
Effort grows with the number of clients, the number of partners and the key infrastructure you already have. Each system integration needs its own key pair, its own registration and its own rotation schedule, so ten clients is far more than ten times the bookkeeping of one. Payer or partner requirements add work, because each counterparty may specify accepted algorithms, key formats, token lifetimes and sandbox testing steps. Key infrastructure matters too: a team with a managed secrets store and a publishing pipeline for JWKS has less to build than a team storing keys in configuration files. Ask any partner for their written requirements before scoping, because those requirements usually decide the design.
What do we need to provide before the work starts?
You will need to name who holds custody of private keys, confirm that your Medplum server can reach the JWKS endpoint from the networks your partners use, and identify a technical contact at each partner who can run test exchanges. Key custody should be decided in writing: which system generates the key, where the private key is stored, who can read it and how it is destroyed after rotation. Network access is often overlooked, since a partner that cannot fetch your published key set will fail authentication without a clear error. Partner contacts matter because sandbox credentials, accepted algorithms and key registration usually go through them, not through your own team.
Do payers or healthcare specifications require JWT client assertion?
Some do, and the requirement comes from the specification or the payer's implementation guide, not from Medplum itself. The SMART Backend Services specification describes asymmetric client authentication with signed JWTs as the way a system authenticates to a FHIR server without a user present. Payers running prior authorization or bulk data programs may require it, and they may also specify the signing algorithm, key size and maximum assertion lifetime. Shared client secrets are often accepted only in older or internal flows. Before designing anything, collect each counterparty's written authentication requirements and check them against what your Medplum version supports, because a requirement you did not confirm can force a redesign late in the project.
How do Medplum upgrades affect an existing JWT client assertion setup?
An upgrade can change authentication behavior, so every client assertion setup should be retested after each Medplum upgrade, not assumed to keep working. Self-hosted Medplum must be upgraded through each minor version in sequence, and skipping versions causes startup failures, so plan the authentication test as part of each step. Keep your key registration, JWKS publication and assertion settings documented in version control so they can be compared across versions. Keep at least one previous public key available during rotation, and test a rollback path in a non-production environment before it is needed. The upgrade guide and release notes for each version are the sources to check for changes that touch token handling.
What does a fixed-scope DeployOpen engagement for this setup typically cover?
A fixed-scope engagement is agreed in writing before work starts and lists the scope, deliverables and timeline. For this topic, that usually means reviewing your client inventory and partner requirements, designing key custody and rotation, implementing key pairs and the JWKS endpoint in your own infrastructure, configuring client registrations and token exchange, and testing against partner sandboxes. Handover documentation covering rotation runbooks and upgrade test steps is a common deliverable. Work outside the agreed scope, such as building partner-side tooling or extending a payer's certification process, is quoted separately. DeployOpen does not publish a price list, so ask for a quote based on your written scope.
How often do the signing keys need to be rotated?
The rotation interval is a policy decision set by your security team and any partner requirements, not a fixed value from Medplum. Plan rotation as a routine operation: generate the new key pair, publish it alongside the old key in the JWKS, switch signing to the new key, then retire the old key once no valid assertions depend on it. Confirm whether each partner accepts multiple keys in its registration and whether it refreshes your JWKS on a schedule, because a partner with a long cache can reject a new key for a period after rotation. Record each rotation and test it in a non-production environment first.
Keeping the setup working through Medplum upgrades
A client assertion setup can break during an upgrade even when nothing in your integration changed, so treat authentication as part of the upgrade test plan rather than a later check. A self-hosted Medplum server must be moved through each minor version in sequence. Skipping versions causes startup failures, according to the upgrading guide, so an upgrade from an older line is a chain of steps, and each step is a chance for token validation, client configuration or key handling to change. Plan the sequence before the first step, and record which minor version each environment is running.
After each step, retest the full sign-in path for every system integration: request a token using a signed JWT assertion, confirm the access token is accepted by a FHIR read and a write that your policies allow, and confirm a request with a wrong key, an expired assertion or a reused jti is still rejected. Check that the JWKS endpoint still serves the keys your clients expect, that the aud value and the token endpoint URL match what partners have configured, and that the client_id and any scope settings in the ClientApplication still resolve. Confirm the behavior for each supported algorithm in your own setup, since the release notes are the place to check for changes.
Security patches have set targets. Medplum's versioning policy aims to ship fixes for critical vulnerabilities (CVSS 9.0 or higher) within 7 days and for high ones (CVSS 7.0 to 8.9) within 14 days, so keep a staging copy that can take a patch release quickly. Before production upgrades, run the authentication tests against staging, and ask the vendor or your partner to confirm which authentication behaviors changed between the versions you are crossing. Keep the previous key pair available for rollback until the new version has run through a full integration cycle.
How DeployOpen scopes and delivers SMART Backend Services setups
A SMART Backend Services setup touches key generation, client registration, token flow testing, and the infrastructure that hosts Medplum. DeployOpen plans and implements these pieces inside your own environment, agrees the scope in writing before work starts, and documents the result so your team can run it.
Scoping the work in writing
Before any build starts, the scope is agreed in writing: which Medplum ClientApplications need JWT client assertion, which systems call them, which signing algorithms and key storage your security team accepts, and how the change fits your Medplum version. Most engagements are fixed-scope, so deliverables and timelines are fixed on paper. Ask the partner to list every client, key and endpoint that will change, and to state what is out of scope, such as payer-specific certificate requirements that the payer defines.
Self-hosted deployment in your infrastructure
DeployOpen implements and hardens self-hosted Medplum in the cloud accounts, data centers or air-gapped networks you control, so the token endpoint, JWKS endpoint and any private key material stay where your security team can review them. Confirm which deployment path your environment uses, because the supported methods differ in maturity. The Medplum self-hosting docs describe AWS with CDK and CloudFormation as the recommended option, with Terraform-based GCP and Azure deployments marked Beta.
Medplum self-hosting docsKey handling and rotation controls
Private signing keys are the main risk in this setup. DeployOpen plans where keys are generated, how they are stored, who can read them, and how each integration is rotated without an outage. Rotation is documented as a runbook with a tested overlap window, so the old and new public keys are both published while partners switch over. Ask for the key inventory, owner for each key, and the revocation steps written into the handover.
Token flow and negative testing
DeployOpen tests the full client assertion flow against your Medplum instance: a valid assertion, expired assertions, wrong audience, unsupported algorithms, unknown key IDs and replayed tokens. Each result is recorded with the expected outcome, so the test evidence can be shared with integration partners or auditors. The test plan is written in your own environment, with your clients, not against a generic sample.
Upgrades and version alignment
Medplum ships major versions annually in Q4 and patch versions weekly, and self-hosted servers must move through each minor version in sequence. Token behavior can change between versions, so the setup is re-tested after each upgrade. Confirm with DeployOpen how the upgrade plan covers the JWKS endpoint, existing client registrations and the rollback path before any production change.
- Latest release at research
- 5.2.5
Documentation and retainers
DeployOpen documents the key layout, client registrations, rotation schedule, test results and operational runbooks so your engineers can own the setup after handover. Ongoing support, upgrades and continuous testing are available as retainers, which suit teams that add new integrations or partners over time. Ask for the documentation list in the quote and agree in writing who holds each runbook and which items recur.

