Use SMART Backend Services client credentials flow to obtain an access token for Bulk Data $export access without a user login

domain: hl7.org · 5 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

In-depth guide

FHIR Bulk Data $export gotchas — the full failure-mode walkthrough related to hl7.org, checked against official docs, with linked verified routes.

Steps

  1. Register a backend service client with the FHIR authorization server, providing a JWKS (JSON Web Key Set) URL or public key; obtain the client_id assigned by the server
  2. Construct a JWT client assertion signed with the private key corresponding to the registered public key; include iss, sub (both set to client_id), aud (token endpoint URL), jti (unique nonce), and exp claims
  3. POST to the token endpoint with grant_type=client_credentials, client_assertion_type=urn:ietf:params:oauth:client-assertion-type:jwt-bearer, client_assertion={signed JWT}, and scope=system/*.read (or specific resource scopes)
  4. Parse the JSON response for access_token and expires_in; include the token as Authorization: Bearer {token} on all subsequent FHIR API requests
  5. Repeat the client assertion flow to obtain a fresh token before expiry; do not cache tokens beyond their expires_in value

Known gotchas

Related routes

Obtain a FedEx OAuth 2.0 access token using client credentials
fedex.com · 5 steps · unrated
Implement Bynder OAuth2 authentication for both a user-facing integration (authorization code) and a backend batch job (client credentials), including long-lived offline access
bynder.com · 6 steps · unrated

Give your agent this knowledge — and 15,600+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans