Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Capabilities and conformance

FerroSMART implements SMART App Launch 2.2.0 on OAuth 2.0 and OpenID Connect, and is held to it by the Inferno SMART App Launch test kit in CI. The specifications are vendored in the repository under docs/specs/ at the versions docs/VERSIONS.md pins.

The discovery documents

FerroSMART serves three documents under its issuer, each with absolute endpoint URLs:

DocumentPathSpecification
Authorization server metadata/.well-known/oauth-authorization-server, inserted between the host and the issuer’s pathRFC 8414 §3
OpenID Connect discovery{issuer}/.well-known/openid-configurationOpenID Connect Discovery 1.0 §4
SMART configuration{issuer}/.well-known/smart-configurationSMART App Launch 2.2.0, Conformance

Which document it serves depends on whether people log in. With an identity provider configured, the SMART document is the App Launch document. Without one, FerroSMART answers Backend Services alone and the document says so.

The capabilities it advertises

The SMART App Launch 2.2.0 Conformance page lists capabilities a server supports. FerroSMART’s App Launch document lists these:

CapabilityWhat it means here
launch-standaloneThe authorization endpoint takes an app that starts on its own
launch-ehrAn app launched by an EHR with a launch value (EHR launch API)
authorize-postThe authorization endpoint takes the request by GET and by POST
client-publicA public client authenticates with PKCE alone
client-confidential-symmetricA confidential client authenticates with its secret, client_secret_basic or client_secret_post
client-confidential-asymmetricA confidential client authenticates with a private_key_jwt assertion signed RS384 or ES384
sso-openid-connectopenid and fhirUser give the app an ID Token signed RS256 with the person’s fhirUser
context-ehr-patient, context-ehr-encounterThe patient and encounter of an EHR launch reach the token response
context-standalone-patientThe patient picker chooses the patient of a standalone launch, when a resource server can be searched
context-standalone-encounterThe picker chooses one of that patient’s encounters, at a FHIR server
context-bannerneed_patient_banner reaches the token response
context-styleThe token response carries smart_style_url, when one is configured
permission-offline, permission-onlineRefresh tokens under offline_access and online_access
permission-patient, permission-userpatient/ and user/ scopes
permission-v1SMART v1 scopes (.read, .write, .*), matched by their v2 form and granted as asked
permission-v2SMART v2 scopes (.cruds)

The Backend Services document lists client-confidential-asymmetric.

Both documents advertise code_challenge_methods_supported: ["S256"] and never plain, token_endpoint_auth_signing_alg_values_supported: ["RS384", "ES384"], the introspection and revocation endpoints, and, with login, management_endpoint, where a person sees the apps they allowed and every app holding live access to their data, and disconnects any of them.

The endpoints

Method and pathWhat it isGround
GET {issuer}/jwksThe public keys that sign tokens, as bare JWKsRFC 7517 §5
GET, POST {issuer}/authorizeThe authorization endpointSMART App Launch 2.2.0; RFC 6749 §3.1
GET {issuer}/callbackThe identity provider’s redirect backOpenID Connect Core 1.0 §3.1.2.5
GET, POST {issuer}/pickerThe patient pickerour own design
GET, POST {issuer}/consentThe consent pageour own design
GET, POST {issuer}/manageThe person’s remembered consents and every app holding live access, organisation-approved apps included, each with DisconnectSMART App Launch 2.2.0, management_endpoint
POST {issuer}/tokenThe token endpointRFC 6749 §3.2
POST {issuer}/introspectToken introspectionRFC 7662 §2
POST {issuer}/revokeToken revocationRFC 7009 §2
POST {issuer}/launchThe EHR launch APIour own design
POST {issuer}/backchannel-logoutThe identity provider’s logout noticeOpenID Connect Back-Channel Logout 1.0
GET {issuer}/frontchannel-logoutThe identity provider’s logout notice, in its iframeOpenID Connect Front-Channel Logout 1.0
GET, POST {issuer}/logoutThe end-session endpoint, with its confirmation at {issuer}/logout/confirm and the provider’s return at {issuer}/logout/returnOpenID Connect RP-Initiated Logout 1.0
GET {issuer}/auditFerroSMART’s own audit recordsour own design
GET {issuer}/upstream-jwksThe keys FerroSMART signs its own client assertions to the identity provider withour own design
GET {issuer}/health, /health/liveness, /health/readiness, /health/infoHealththe FerroHEALTH family

OpenID Connect parameters

FerroSMART is an OpenID Provider toward its apps and takes the parameters OpenID Connect Core 1.0 §15.1 has every provider support, beside SMART’s PKCE and aud, which stay required. FerroSMART keeps no session of its own, so every request logs the person in at the identity provider, and the parameters about that login go there:

ParameterWhat FerroSMART does
prompt=noneAnswers login_required to the app at once, with no page
prompt=login, prompt=select_accountPassed to the identity provider’s login
prompt=consentShows the consent page even when a remembered consent or an approval would answer
max_agePassed to the identity provider; a login older than it is begun again once with prompt=login, and one still older answers login_required
ui_localesPassed to the identity provider, and chooses the pages’ language before the browser’s
display, claims_locales, acr_valuesTaken without changing the flow

Every ID Token is signed RS256 and carries auth_time, the time the person authenticated at the identity provider. FerroSMART has no UserInfo endpoint: the ID Token and its fhirUser claim identify the person.

What SMART leaves open, and how FerroSMART decides

Where the specifications are silent, FerroSMART makes one fixed decision and the architecture records it as its own design:

  • The launch context in the access token. SMART puts patient, encounter and fhirUser in the token response. FerroSMART writes them, and ehrId for an openEHR server, into the access token as well, so a resource server that reads the JWT has them (RFC 9068 §2.2.2).
  • Scopes. The granted scope is what the request asks for, narrowed to the client’s registered ceiling, the scopes the person’s roles allow and what the person approves (clients, roles and consent).
  • Consent where it protects the person. A user flow shows the consent page unless the person remembered that choice for that client and resource server, or an administrator approved the client and the request stays within that approval: for the organisation’s professionals (with patient/ scopes only in an EHR launch), and for the organisation’s own app (first_party) its patients too, lasting access included (OpenID Connect Core 1.0 §3.1.2.4, “previous administrative consent”). An app of another party always shows a patient the page (SMART App Launch 2.2.0, Best Practices). A public client without a claimed https redirect, and an app’s prompt=consent, always show the page (RFC 8252 §8.6; OpenID Connect Core 1.0 §3.1.2.1). Every app holding live access can be disconnected on the management page. The consent rules lists every case.
  • online_access. An online refresh token ends when the person’s login at the identity provider ends, signalled by back-channel or front-channel logout, when the person logs out at the end-session endpoint, or after online_idle unused.
  • The person’s sub. A pairwise identifier derived from the identity provider’s issuer and sub, so the provider’s identifier never reaches a resource server.
  • Refresh rotation for every client. Each refresh rotates the token, and a rotated token presented again revokes the whole grant, unless its own client repeats it within 10 seconds while the new token is unused: a retry or a race then gets the same new token.
  • Introspection. A confidential client authenticated as at the token endpoint (its assertion or its secret), or a bearer token FerroSMART issued, each holding the scope system/introspect (RFC 7662 §2.1).

The test kit in CI

The CI lane runs the four groups of the kit’s STU 2.2 server suite (smart_stu2_2): the standalone launch, the EHR launch, Backend Services and token introspection. FerroSMART runs with Keycloak upstream and FerroBRIDGE’s FHIR R4 facade as the FHIR server, all over TLS, and every test of the suite passes. The lane fails when a result changes, and the list of tests it may expect anything other than a pass is empty.

The OpenID Foundation conformance suite in CI

A second CI lane runs four plans of the OpenID Foundation conformance suite against FerroSMART. Each module is held to the result recorded in app/ferrosmart/oidf/expected.tsv, and an expected failure names its issue.

PlanFerroSMART’s roleIts client authentication at the suite
oidcc-client-test-planRelying party, logging in at the suiteprivate_key_jwt, and client_secret_basic for the module oidcc-client-test-client-secret-basic
oidcc-client-basic-certification-test-planRelying partyclient_secret_basic, with the secret read from a file
oidcc-config-certification-test-planOpenID ProviderNot applicable: the suite reads the discovery document
oidcc-basic-certification-test-planOpenID ProviderNot applicable: the suite is a confidential client of FerroSMART

As the relying party, FerroSMART runs from one configuration that names no client authentication, and the lane adds the method each module fixes, as an administrator sets it for a provider (see Identity providers).