SMART App Launch

Check a SMART authorize request

  • Sandbox: available
  • On your own host? Choose https://{host} in the playground.
POST
/v1/smart/sign-in/request

Checks a SMART app's authorize request before the user signs in, and names the app and the scopes it gets.

Scope: none; anyone may call it. The SMART sign-in page on www.ovok.com calls it with the parameters Ovok's authorize handed it.

Behaviour

  • The request must pass the store's own authorize rules: a known client_id, a redirect_uri the app registered exactly, response_type=code, a scope, an aud on Ovok's host, and PKCE with S256 unless the app is exempt. Otherwise 400 SMART_AUTHORIZE_INVALID, whose detail names the RFC 6749 error, and nothing reaches the app.
  • An EHR launch (launch set) signs in at the store instead: 400.
  • scopes are what the app will get: patient/ writes are granted as reads.
  • cancel is the app's redirect_uri with error=access_denied and its state.

Request Body

application/json
  1. body
authorize*

The app's authorize parameters, unchanged: client_id, redirect_uri, scope, state, PKCE, aud.

Response Body

The app, the scopes it gets, and the Cancel URL.

application/json
  1. response
app*

The app asking to sign in.

scopes*array<string>

The scopes the app gets: patient/ writes are granted as reads.

cancel*string

Where Cancel sends the browser: the app's redirect URI with error=access_denied.

Example Request
curl -X POST 'https://api.sandbox.ovok.com/v1/smart/sign-in/request' \  -H 'Content-Type: application/json' \  -d '{  "authorize": {    "property1": "string",    "property2": "string"  }}'
Example Response
{  "app": {    "name": "string",    "logoUrl": "string"  },  "scopes": [    "string"  ],  "cancel": "string"}

Mint a SMART launch POST

Mints the `launch` value an app opened from Ovok passes to `authorize`, so its token carries this patient (and encounter) and its `patient/` scopes reach this patient's data only. **Scope:** the caller's project (from the token). The caller must be able to read the patient and the encounter themself; Ovok stores the launch in the caller's project. ## Behaviour - Open the app's launch URL with `iss` and `launch`: `<launch URL>?iss=<iss>&launch=<launch>`. The app sends `launch` to `authorize`, and its token answer names the patient (and `encounter`). - The encounter, when given, must be the patient's. - A token whose SMART scopes are all `patient/` ones may not call this. ## Example ```bash curl -X POST 'https://api.sandbox.ovok.com/v1/smart/launches' -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3NjcyNjg4MDAsImV4cCI6MTc2NzI3MjQwMH0.Ql3B_ztDvctlyZ2z0vp4sl3ExXRQGkzmxdmTAqxNzZk' \ -H 'Content-Type: application/json' -d '{"patient":"Patient/3a7f2c1e-0b4d-4f6a-9c2e-1d8b5a6f7e90"}' ```

Sign in for a SMART app POST

Signs a user in for a SMART app's standalone launch: one password, then Ovok answers the app itself. **Scope:** the app's project. The user must have a profile there: a Patient, a Practitioner or a RelatedPerson. ## Behaviour - The `authorize` parameters are checked as `POST /v1/smart/sign-in/request` checks them. - The answer is the next step, with a `session` handle for it: `mfa` (an authenticator code), `profile` (choose one of the user's profiles in the project), `patient` (pick a patient), or `done`. - A Patient gets their own record and goes straight to `done`; anyone else picks a patient they may read. - `done` carries `redirect`: the app's `redirect_uri` with `code` and `state`. The app exchanges the code at `https://api.sandbox.ovok.com/oauth2/token` with its PKCE verifier, and its token names the patient. - A project with login off refuses its users (403), except a practitioner who administers it. - A session lasts 10 minutes and answers the app once. ## Example ```bash curl -X POST 'https://api.sandbox.ovok.com/v1/smart/sign-in' -H 'Content-Type: application/json' \ -d '{"authorize":{"response_type":"code","client_id":"<client id>","redirect_uri":"https://app.example.com/callback","scope":"launch/patient openid fhirUser patient/*.rs","state":"af0ifjsldkj","code_challenge":"<S256 challenge>","code_challenge_method":"S256"},"email":"dr.weber@example.com","password":"<password>"}' ```