Sign in for a SMART app
- Sandbox: available
- On your own host? Choose https://{host} in the playground.
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
authorizeparameters are checked asPOST /v1/smart/sign-in/requestchecks them. - The answer is the next step, with a
sessionhandle for it:mfa(an authenticator code),profile(choose one of the user's profiles in the project),patient(pick a patient), ordone. - A Patient gets their own record and goes straight to
done; anyone else picks a patient they may read. donecarriesredirect: the app'sredirect_uriwithcodeandstate. The app exchanges the code athttps://api.sandbox.ovok.com/oauth2/tokenwith 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>"}'application/json- body
authorize*The app's authorize parameters, unchanged: client_id, redirect_uri, scope, state, PKCE, aud.
email*stringThe user's email.
emaillength <= 320password*stringThe user's password.
1 <= length <= 1024The next step.
application/json- response
next*stringWhat the page asks for next, or done.
"mfa""profile""patient""done"session*stringThe handle for the next step; null when done.
profiles*array<>The profiles to choose from, when next is profile.
redirect*stringWhere to send the browser when next is done: the app's redirect URI with code and state.
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"}'{ "next": "mfa", "session": "string", "profiles": [ { "membership": "string", "resourceType": "string", "name": "string", "project": "string" } ], "redirect": "string"}Check a SMART authorize request POST
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`.
Verify a SMART sign-in code POST
Verifies the authenticator code of a SMART sign-in whose step is `mfa`, and answers the next step. ## Behaviour - A wrong code is 400. After 5 wrong codes the sign-in ends: start again.