Launch Context
SMART launch context (the patient, encounter, fhirUser and the rest an app receives with its token) is resolved during each authorization, not configured per user. There is no admin API for storing it on a user.
Where context comes from
- EHR launch. The EHR, or an agent acting for its signed-in user, calls
POST /auth/launchwith the context to launch with and hands the app the signedlaunchcode it gets back. See EHR Launch. - Task-based launch.
POST /auth/launch/taskacts on a SMART launch Task and returns the app launch URL. See Task-Based App Launch. - Standalone launch. An app that asks for
launch/patientorlaunch/encounterwithout an EHR gets the context from a PatientfhirUser, or from the Patient Picker, which pauses the authorization for a practitioner to choose it.
What the app receives
The token response carries the resolved context, and token introspection repeats these fields for as long as the token is valid:
patient, encounter, fhirUser, fhirContext, intent, smart_style_url, tenant, need_patient_banner, act, scope
The context is stored by the token's jti, shared through PostgreSQL when a database is configured, and survives a refresh. See Database and multi-node state.
Configuring what can be requested
Which launch scopes an app may request is part of its SMART app registration (SMART Apps), and the Keycloak client scopes and protocol mappers behind them are managed in Scope Management.