SMART App Launch

Sign in for a SMART app

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

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

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>"}'

Request Body

application/json
  1. body
authorize*

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

email*string

The user's email.

Formatemail
Lengthlength <= 320
password*string

The user's password.

Length1 <= length <= 1024

Response Body

The next step.

application/json
  1. response
next*string

What the page asks for next, or done.

Value in"mfa""profile""patient""done"
session*string

The handle for the next step; null when done.

profiles*array<>

The profiles to choose from, when next is profile.

redirect*string

Where to send the browser when next is done: the app's redirect URI with code and state.

Example Request
curl -X POST 'https://api.sandbox.ovok.com/v1/smart/sign-in' \  -H 'Content-Type: application/json' \  -d '{  "authorize": {    "property1": "string",    "property2": "string"  },  "email": "user@example.com",  "password": "string"}'
Example Response
{  "next": "mfa",  "session": "string",  "profiles": [    {      "membership": "string",      "resourceType": "string",      "name": "string",      "project": "string"    }  ],  "redirect": "string"}