Tenant Authentication

Verify related person MFA code

  • Sandbox: available
  • Staging: available
  • Production: unknown
POST
/auth/tenant/RelatedPerson/login/mfa

Verifies the TOTP code of a related person (carer) who has MFA enrolled, after login/start answered nextStep: "mfa". Returns the session code for login/token.

Auth: none. The loginId from login/start identifies the login.

Behaviour

  • mfaToken must equal the current TOTP code generated from the user's MFA secret.
  • On success the login is marked MFA-verified and the response is { "nextStep": "token", "sessionCode": ... }. Pass sessionCode to POST /auth/tenant/RelatedPerson/login/token.
  • Error responses are delayed to take at least one second.

Example

curl -X POST 'https://api.sandbox.ovok.com/auth/tenant/RelatedPerson/login/mfa' \  -H 'Content-Type: application/json' \  -d '{    "loginId": "c3499c27-2973-0a7f-807e-fb8676a92dcb",    "mfaToken": "123456"  }'

Request Body

application/json
  1. body
mfaToken*string
Length6 <= length
loginId*string
Formatuuid

Response Body

A session code for login/token.

application/json
  1. response
nextStep*"token"
Value in"token"
sessionCode*string
Example Request
curl -X POST 'https://api.sandbox.ovok.com/auth/tenant/RelatedPerson/login/mfa' \  -H 'Content-Type: application/json' \  -d '{  "mfaToken": "string",  "loginId": "8f568ecd-0198-4d41-91e2-cb501f4140f6"}'
Example Response
{  "nextStep": "token",  "sessionCode": "string"}

Exchange related person session code for tokens POST

Finishes a related person (carer) login: exchanges the session code from `login/start` (or `login/mfa`) and your PKCE `codeVerifier` for an access token and a refresh token. **Auth:** none. The session code and code verifier prove the earlier steps. ## Behaviour - Ovok redeems the code with Medplum's `oauth2/token` endpoint (`grant_type=authorization_code`). - The signed-in profile must be a RelatedPerson. A code for any other profile type is refused. - The token reads only what patients have shared with the carer: the shared Observation codes and each sharer's record with its contact fields hidden. Practitioner and patient-only routes refuse it with 403. - If the account was scheduled for deletion (`DELETE /auth/delete`), logging in cancels the deletion. - The response holds `accessToken`, `refreshToken`, `expiresIn` (seconds) and references to the `project` and `profile`. - Error responses are delayed to take at least one second. ## Example ```bash curl -X POST 'https://api.sandbox.ovok.com/auth/tenant/RelatedPerson/login/token' \ -H 'Content-Type: application/json' \ -d '{ "sessionCode": "<sessionCode from login/start>", "codeVerifier": "<your codeVerifier>" }' ```

Fetch user's video call access permission GET

Returns the video call access permission of the signed-in user for one Appointment. Use it to check whether the user has been invited before you request a join link. **Auth:** bearer token. **Scope:** the caller's project (from the token). ## Behaviour - The permission is the `CommunicationRequest` that links the Appointment to the user's profile as recipient. The route returns it without its `meta`. - If there is no such grant for the caller's profile, the route returns 403. - The lookup uses the caller's own profile reference (for example `Patient/<id>`), so a user only ever sees their own permission. ## Example ```bash curl -X GET 'https://api.sandbox.ovok.com/video-call/livekit/access-permission/c3499c27-2973-0a7f-807e-fb8676a92dcb' \ -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3NjcyNjg4MDAsImV4cCI6MTc2NzI3MjQwMH0.Ql3B_ztDvctlyZ2z0vp4sl3ExXRQGkzmxdmTAqxNzZk' ```