This process describes adding an additional authentication method to an existing person, update authentication method and delete it.
Table of Contents |
---|
Specification
Authorize
Verify the validity of access token
Check user scope authentication_method:write in order to perform this action
Get global parameters
Invoke Global parameters to get following parameter:
...
|
Validate request
if action = delete
Code Block | ||
---|---|---|
| ||
{ "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": { "action": "delete", "authentication_methods": { "id": "057413fb-2c2e-4f33-b2d6-433469212744" } } } |
...
Code Block |
---|
{ "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": { "action": "update", "authentication_methods": { "id": "057413fb-2c2e-4f33-b2d6-433469212744", "alias": "roksolana", "default": "true" } } } |
Validate ids
Fiend value
is person.id
validate person.id UUID
in case error return 422
search person by person.id in MPI
in case error return 422, "Such person doesn't exist"
Validate
Use GET persom/{id}/ authentication_method to find authentication method' id of person
if action =
delete
Field
type
must beTHIRD_PERSON
. (where person_auth_method.id = $aythentication_method.id)If person < 14, validate that count(auth_method, where person.auth_methods.person_id = $.person_id) >=1
If delete auth_method where field
default
= True, then the method that was last added has a flagdefault
= True
if action =
insert
if type = OTP or OFFLINE, person’s auth method that was before (off or offline) becomes inactive
if type =
THIRD_PERSON
, set default=false and Calculate term of person_authentication_methodStart date: start_date = Current_date()
End date:
Code Block if (person.age < 18) { end_date = min(birth_date + 18y - 1d, start_date + third_person_term);} else { end_date = start_date + third_person_term;}
if action =
update
if the transferred method is the main one (
default
= TRUE), method that had this flagdefault = TRUE
now hasdefault = FALSE
if person>18, can’t set
default
= TRUE where auth_method.type=THIRD_PERSON
Generate verification code
If action = insert
Invoke Initialize OTP to generate one time password and send it to third_person number (that is added as a new auth method). At this stage, the patients receive an SMS message.
...
|
Generate upload URL
If action = insert
Validate authentication_method. If authentication method.type = third_person (and this third_person.auth_method = OFFLINE) -
Generate URL's with type person.{$.person_request.person.documents.[:].type} (or Generate URL's with type third_person.{$.third_person.documents.[:].type})