Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Azure Health Data Services (AHDS) FHIR service supports Substitutable Medical Applications and Reusable Technologies (SMART on FHIR) by implementing the key server-side behaviors required for SMART clients to securely access FHIR data by using OAuth 2.0 and OpenID Connect. SMART on FHIR is an implementation guide through which applications can access clinical information through a data store. It adds a security layer based on open standards including OAuth2 and OpenID Connect, to FHIR® interfaces to enable integration with EHR systems. Using SMART on FHIR provides at least three important benefits:
- Applications have a known method for obtaining authentication and authorization to a FHIR repository.
- Users accessing a FHIR repository with SMART on FHIR are restricted to resources associated with the user, rather than having access to all data in the repository.
- Users have the ability to grant applications access to a limited set of their data by using SMART clinical scopes.
Prerequisites
Before you begin, make sure you have:
- An AHDS FHIR service instance.
- Permissions to configure FHIR authentication settings.
- An identity provider strategy: Microsoft Entra ID plus an orchestration layer, or A SMART-aware third-party identity provider.
- A test patient in your FHIR store.
- A SMART client application (or the SmartLauncher sample for validation).
End to end flow
A SMART client typically performs these steps:
- Discover: Call
/.well-known/smart-configurationon the FHIR server to find endpoints and capabilities. - Authorize: Redirect the user to the authorization endpoint with requested SMART scopes.
- Token: Exchange authorization code for an access token, then call FHIR APIs with the bearer token.
- Call FHIR APIs: Send the bearer token to the FHIR endpoint. Access is constrained by scopes and context.
Configure access for end users
Assign users to the FHIR SMART user role by using Azure role assignment guidance: Assign Users to Role. Users in this role can access the FHIR service when requests satisfy SMART requirements. Access is limited by fhirUser context and SMART clinical scopes.
Note
A user with the SMART user role has access to perform read API interactions on FHIR service. The SMART user role doesn't grant write access to the FHIR service.
Identity provider support
FHIR service provides integration with Microsoft Entra ID or third-party identity providers (IDP) that understand SMART launch context and SMART scope semantics.
The SMART on FHIR specification defines launch context as a set of parameters that are conveyed during the authorization flow and returned as part of the token response. These parameters typically include identifiers such as the patient ID, encounter ID, and the FHIR user (for example, a practitioner or patient), along with optional fields. Technically, this context is passed into the SMART workflow through a parameter called launch, which is intentionally opaque to the application. The application simply receives and forwards this value during the authorization process. This launch parameter maps to a stored context record, which contains the actual patient and encounter identifiers. During the token exchange step, this context is resolved and returned alongside the access token so that the application can make correctly scoped API calls. This mechanism ensures that when an app accesses FHIR data, it operates within a clearly defined clinical boundary.
Identity providers are responsible for authenticating users and issuing tokens, but they don't have visibility into clinical workflows. The application must determine an appropriate patient context, either by prompting the user, selecting a patient from a list, or retrieving it from another system. Regardless of how this context is established, the application must include it in the token that it uses to call the FHIR service.
This architecture provides an orchestration layer that acts as the bridge between the identity provider, the clinical system (such as an EHR), and the FHIR service.
Sample integration
Use the Azure Health Data and AI Samples open source repo to set up the SMART on FHIR experience. The repository provides the sample SMART on FHIR v2 — Native IdP-Agnostic Sample.
This sample demonstrates the creation of an orchestration layer that acts as the bridge between the identity provider, the clinical system (such as an EHR), and the FHIR service. It supports both Microsoft Entra ID or an external identity provider (for example, Okta). See the sample repository for detailed instructions on how to configure and run the sample.
Note
Samples are open-source code, and you should review the information and licensing terms on GitHub before using them. They're not part of the Azure Health Data Service and Microsoft Support doesn't support them. These samples demonstrate how Azure Health Data Services (AHDS) and other open-source tools can be used together to demonstrate §170.315(g)(10) Standardized API for patient and population services criterion compliance, using Microsoft Entra ID as the identity provider workflow.
Microsoft Entra ID integration
Microsoft Entra ID is a full-featured OAuth 2.0 and OpenID Connect identity provider. To integrate Microsoft Entra ID as the identity provider, you need extra components to complete the end-to-end SMART on FHIR experience. This requirement exists because SMART on FHIR introduces behaviors that enterprise identity providers like Entra ID don't natively support. To bridge this gap, Microsoft provides reference solutions (samples). The sample provides an orchestration layer between SMART clients and Entra ID.
The sample supports the following scenarios for Microsoft Entra ID:
- A scope value such as
patient/Patient.rsisn't a registered Entra ID permission, so Entra ID rejects the authorize request. - It doesn't offer a per-request scope picker for the SMART resource verbs. Entra's consent screen reflects pre-registered application permissions, not the dynamic
patient/<Resource>.<verbs>the SMART app sends on each launch. - It doesn't advertise a SMART discovery document — smart-configuration is FHIR-server territory, not IdP territory.
SMART on FHIR v1/v2 support
AHDS FHIR service supports SMART v1.0.0 and SMART v2.0.0. You can't mix and match SMART v1.0.0 and SMART v2.0.0 scopes in the same client app registration. You must choose one or the other.
Migrate from SMART on FHIR Proxy to SMART on FHIR
Click to expand
Important
SMART on FHIR proxy is retiring in September 2026. Transition to the SMART on FHIR by that date. Beginning September 2026, applications relying on SMART on FHIR proxy report errors in accessing the FHIR service.
SMART on FHIR provides more capabilities compared to SMART on FHIR proxy. Use SMART on FHIR to meet requirements with SMART on FHIR Implementation Guide (v 1.0.0), SMART on FHIR Implementation Guide (v 2.0.0), and §170.315(g)(10) Standardized API for patient and population services criterion. The following table lists the differences between SMART on FHIR proxy and SMART on FHIR. SMART on FHIR Implementation Guide (v2.0.0) is only supported in SMART on FHIR sample.
| Capability | SMART on FHIR | SMART on FHIR proxy |
|---|---|---|
| Supports Standalone Launch | Yes | No |
| Supports EHR Launch | Yes | Yes |
| Supports scope restrictions | Yes | No |
| Relies on first party Azure products | Yes, Azure products such as Azure API Management (APIM) need to be integrated | No |
| Microsoft Support | Supported for FHIR service.Open-source sample support needs to be reported and monitored via GitHub | Supported for FHIR service |
Migration steps
- Assign users to the FHIR SMART user role. FHIR SMART user role allows users to access the FHIR service if their requests comply with the SMART on FHIR implementation guide. Follow the steps listed under section Manage Users: Assign Users to Role.
- Deploy SMART on FHIR sample SMART on FHIR v2 — Native IdP-Agnostic Sample.
- Update endpoint of the FHIR service url to '{{BASEURL_FROM_APIM}}/smart.'
- Uncheck the SMART on FHIR proxy setting under Authentication blade for the FHIR service.
If you have questions, you can get answers from community experts in Microsoft Q&A. For technical support, you can also create a support request.
Next steps
Now that you understand how to enable SMART on FHIR functionality, see the search samples page for details about how to search by using search parameters, modifiers, and other FHIR search methods.
Note
FHIR® is a registered trademark of HL7 and is used with the permission of HL7.