Implement SMART Backend Services authorization for payer bulk data export access

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

Steps

  1. Review the SMART App Launch IG Backend Services section (hl7.org/fhir/smart-app-launch) to understand the client credentials flow using asymmetric JWT authentication.
  2. Generate an RSA or EC key pair for the backend service; register the public key (or JWKS URL) with the FHIR authorization server out-of-band (typically via a payer portal or API management system).
  3. Construct a JWT client assertion: set iss and sub to the registered client_id, aud to the authorization server's token endpoint URL, exp to a short future timestamp (e.g., 5 minutes), and jti to a unique nonce; sign with the private key.
  4. POST the token request to the authorization server's token endpoint with grant_type=client_credentials, client_assertion_type of urn:ietf:params:oauth:client-assertion-type:jwt-bearer, client_assertion set to the signed JWT, and scope set to the required system-level scopes (e.g., system/Patient.read, system/ExplanationOfBenefit.read).
  5. Receive the access token response; extract the access_token and expires_in values; store the token and implement proactive refresh before expiry.
  6. Use the access token as a Bearer token in the Authorization header of all FHIR Bulk Data requests; handle 401 responses by refreshing the token rather than surfacing an authentication error to the application layer.

Known gotchas

Related routes

Configure SMART Backend Services bulk group-level $export for population data extraction
healthcare-fhir · 6 steps · unrated
Use SMART Backend Services client credentials flow to obtain an access token for Bulk Data $export access without a user login
hl7.org · 5 steps · unrated
Authenticate a backend service for FHIR Bulk Data access using SMART Backend Services client credentials flow
hl7.org/fhir · 5 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