About
How access works in Fresh
Fresh does not hold clinical data. It holds the configuration that decides which person, acting as which clinical record, may open which workspace, and what the token their apps carry is allowed to do. This page follows that chain from one end to the other.
The chain
Eleven links, each configured in the console except the last three, which happen at runtime on every request.
- 1. Organization — owns the configuration
- 2. FHIR backend — the clinical record service
- 3. Authorization service — sandbox, Fresh or brokered
- 4. SMART registrations — client id, redirects, scopes
- 5. EHR workspace — shell, listing, desk, chart
- 6. Workspace assignment — who may open it
- 7. Clinical identity — member × backend → reference
- 8. Access profile — full, read only or own record
- 9. Access token — narrowed scopes
- 10. Backend policy — validates and enforces
- 11. The record — read or written
Three authorization families
Every FHIR backend carries one. It decides where the app authorizes, who signs the token and who checks it when the app calls the API.
A Fresh issuer launch, step by step
What happens between a clinician selecting an app in the listing and the app drawing the patient’s record, when the backend’s family is fresh (Fresh issues tokens).
- 1Shell. The workspace shell asks Fresh to launch an installed app for the identity and the patient in context.
- 2Launch URL. Fresh records a launch context and opens the app's launch URL with iss set to /fhir/<backend> and launch set to that context.
- 3App. The app's SMART client reads iss and launch and begins the authorization code flow.
- 4Discovery. It fetches <iss>/.well-known/smart-configuration for the authorize, token and JWKS endpoints.
- 5Authorize. GET /oauth/authorize checks the Fresh session, the launch context, the audience, the client, the redirect URI, the requested scopes and PKCE.
- 6Code. Fresh narrows the granted scopes to the identity's access profile and redirects back with a one-time code.
- 7Token. POST /oauth/token exchanges the code and the PKCE verifier for a short-lived ES256 JWT carrying the user, the patient, the scopes and the profile.
- 8Facade. The app calls /fhir/<backend>/… with that token. The resource facade verifies the signature and audience, checks the scope for the action, and enforces the patient compartment.
- 9Record. The facade proxies the call upstream to the backend's base URL and streams the record back. The client's token is never forwarded upstream.
Three places access is enforced
No single check is trusted on its own. An access profile of read only or own record is applied when the token is minted and again when the record is fetched.