Check a SMART authorize request
- Sandbox: available
- On your own host? Choose https://{host} in the playground.
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
authorizerules: a knownclient_id, aredirect_urithe app registered exactly,response_type=code, a scope, anaudon Ovok's host, and PKCE withS256unless the app is exempt. Otherwise 400SMART_AUTHORIZE_INVALID, whose detail names the RFC 6749 error, and nothing reaches the app. - An EHR launch (
launchset) signs in at the store instead: 400. scopesare what the app will get:patient/writes are granted as reads.cancelis the app'sredirect_uriwitherror=access_deniedand itsstate.
application/json- body
authorize*The app's authorize parameters, unchanged: client_id, redirect_uri, scope, state, PKCE, aud.
The app, the scopes it gets, and the Cancel URL.
application/json- response
app*The app asking to sign in.
scopes*array<string>The scopes the app gets: patient/ writes are granted as reads.
cancel*stringWhere Cancel sends the browser: the app's redirect URI with error=access_denied.
curl -X POST 'https://api.sandbox.ovok.com/v1/smart/sign-in/request' \ -H 'Content-Type: application/json' \ -d '{ "authorize": { "property1": "string", "property2": "string" }}'{ "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>"}' ```