Table of Contents | ||||
---|---|---|---|---|
|
...
Page Properties | |||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||||||||||||
|
Logic
Update grant code in mithril database,
tokens
table, set:details.used = true
updated_at = now()
Generate ‘access token’ with requested scopes for
user_id
andclient_id
based on value of ACCESS_TOKEN_JWT configuration parameter:true - generate token in JWT format according to Access tokens JWT format
false - generate token in existing format
Generate ‘refresh token’.
Save tokens that were generated in existing format to mithil database,
tokens
table, set:id = token uuid
name = token name (‘access_token’ or ‘refresh_token')
value = hased token
expires_at = date and time when token will be expired in unix-time format
details = additional details of token (scopes, client_id, grant_type, applicant_user_id, applicant_person_id, app_id)
applicant_user_id = value of
details.applicant_user_id
from grant code (if exists)applicant_person_id = value of
details.applicant_person_id
from grant code (if exists)app_id = uuid of approval between
user_id
,applicant_user_id
andclient_id
user_id = id of user
inserted_at = now()
updated_at = now()
Render a response according to specification.
...
Attribute | Values | Type | Description | Example |
---|---|---|---|---|
client_id (required) | String | Medical Service provider ID issued after legal_entity registration. Used to identify the context of the MSP/Pharmacy | 6498d88e-97fb-47e2-85a5-99e884f888aa | |
client_secret (required) | String | Medical Information System secret key issued upon integration request. Used to identify application developer | msp-001-secret-key | |
code (required) | String | oAuth code grant | 299383828 | |
grant_type (required) | String | oAuth Grant Type. Currently only | authorization_code | |
redirect_uri (required) | String | URL where user will be redirected after authentification. This url will receive | ||
scope (required) | String | List of scopes that is required in application business logic, separated by space. Different login forms will be shown based on scopes that you requested | capitation_contracts:view capitation_contracts:create patients:view patients:create |
Request structure
Example
Expand | ||
---|---|---|
| ||
|
...
API paragraph not found
Response structure
Example:
Code Block |
---|
{ "meta": { "code": 201, "url": "https://example.com/resource", "type": "object", "request_id": "6617aeec-15e2-4d6f-b9bd-53559c358f97#17810" }, "data": { "value": "SnNRdCtvU0tTOENBV2dLRUZwNmIzZz09", "user_id": "3ff33ced-69dc-415a-b231-c6446898335a", "name": "access_token", "id": "3ff33ced-69dc-415a-b231-c6446898335a", "expires_at": 1498749591, "details": { "scope": "capitation_contracts:view capitation_contracts:create patients:view patients:create", "refresh_token": "my-oauth-refresh-token", "redirect_uri": "https://example.com/", "grant_type": "authorization_code", "client_id": "d290f1ee-6c54-4b01-90e6-d701748f0851" } } } |
...