SMARTapplaunchmultiserverauthentication, published by HL7. This guide is not an authorized publication; it is the continuous build for version 0.1.0 built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/jmandel/smart-multi-auth/ and changes regularly. See the Directory of published versions
The section enables applications to obtain authorization from multiple systems while maintaining appropriate user consent and security controls. It builds on existing SMART App Launch flows, executing them sequentially with contextual information passed between authorization requests.
The Application retrieves the EHR's SMART configuration from [ehrFhirBaseUrl]/.well-known/smart-configuration
. The imaging server URL [imagingServerFhirBaseUrl]
is discovered through the associated_endpoints
array.
Servers that want to advertise associated endpoints supporting Dual SMART Launch will include the "smart-imaging-access-dual-launch" capability in the associated endpoint's capabilities array:
{
"capabilities": [...],
"associated_endpoints": [{
"url": "[imagingServerFhirBaseUrl]",
"capabilities": ["smart-imaging-access-dual-launch"]
}]
}
Next, the application retrieves the SMART configuration from [imagingServerFhirBaseUrl]/.well-known/smart-configuration
. This configuration generally would not include associated_endpoints
. The configuration's capabilities array MUST include "smart-imaging-access-dual-launch" to indicate support for receiving an OpenID Connect id_token
as a login_hint
.
The application initiates a SMART App Launch flow with the EHR, requesting authorization including the openid
and fhirUser
scopes to ensure receipt of an OpenID Connect id_token
. This follows the standard SMART App Launch specification process for obtaining an authorization code.
The application exchanges its authorization code for an Access Token Response that includes:
id_token
as requested via the scopesBefore initiating authorization with the imaging server, the application must preserve its current authorization state. This includes:
id_token
The application may store this state either client-side (e.g., browser sessionStorage
) or server-side. The specific storage mechanism is implementation-dependent but must ensure appropriate security controls.
The imaging server MUST verify the requesting client's credentials by retrieving the client's registration details from the EHR's client discovery endpoint. The EHR MUST make its client discovery endpoint location available out of band to the imaging server.
The imaging server:
[ehrClientDiscoveryEndpoint]/clients/[clientId]
redirect_uri
NOTES:
The application initiates a SMART on FHIR standalone launch request to the imaging server's authorize endpoint. This request includes:
id_token
(from the EHR) in the login_hint
parameterThe imaging server initiates an authorization request to the EHR's authorization endpoint with:
id_token
passed in the id_token_hint
parameterprompt=none
to request automated authenticationThe EHR processes this request and, if valid:
id_token_hint
id_token
The imaging server MUST present an authorization screen to the user asking if they want to authorize the supplied client to access imaging data. This divides authorization decision-making between:
The imaging server has multiple options for implementing its authorization policy:
Independent Policy: The imaging server can implement its own access policy based on the patient and user context received from the EHR
EHR-Integrated Policy: If the EHR hosts ImagingStudy FHIR resources, the imaging server can gate access based on which studies are visible using the EHR-provided access token. This allows for shared enforcement of access rules between the systems.
After user approval, the application exchanges its authorization code for an Access Token Response from the imaging server. This token grants access specifically to the approved imaging resources.
The client application can now access:
Each system maintains independent access control and token validation.