Table of Contents | ||||
---|---|---|---|---|
|
Required parameters are marked with "*"
...
Purpose
...
Use this method to approve previously created Authentication method Request.
Specification
...
Page Properties | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
...
|
Preconditions
Authentication method Request must be created.
Logic
Use this method to approve previously created Authentication method Request.
...
In case if authentication_method is OFFLINE, request body should be empty. Before approve patient's scanned documents should be uploaded to the (Signed URL's). All links are generated for one one-page document in jpeg format. Document should be no more than 10MB.
Confluence - https://e-health-ua.atlassian.net/wiki/x/G4DJJ
Input parameters
Input parameter | Values | Type | Description | Example |
---|---|---|---|---|
id | String | Person identifier |
| |
request_id | String | Request identifier |
|
Request structure
...
See on Apiary
Example:
Expand | ||
---|---|---|
| ||
|
Authorize
...
Verify the validity of access token
Return 401 in case validation fails
Check scopes in order to perform this action (scope = 'authentication_method_request:write')
Return 403 in case invalid scope(s)
Request to process the request using a token in the headers
Headers
...
Content-Type:application/json
Authorization:Bearer c2778f3064753ea70de870a53795f5c9api{{access_token}}
Api-key:uXhEczJ56adsfh3Ri9SUkc4en{{secret}}
Request data validation
...
Check if Person should be sent for verification*
...
Rules for validation of Persons
Person has OFFLINE auth method (check in Request)
Person's age >= no_self_auth_age and no_tax_id = true (check in DB)
Person's age >= no_self_auth_age and Person’s tax_id is invalid: not match with birth date and gender (check in DB)
Person’s age < no_self_auth_age and has document with type BIRTH_CERTIFICATE_FOREIGN (check in DB)
Person’s age >= no_self_auth_age and has document with type PERMANENT_RESIDENCE_PERMIT (check in DB)
action = deactivate
validate auth_method_request.auth_method_current:
If auth_method_request.auth_method_current = OTP - Verificate sms (Invoke verification module to verify OTP (OTP Verification))
If auth_method_request.auth_method_current = OFFLINE - verificate download documents ( Media Content Storage)
Update authentication method request
Change entity status in IL_DB.authentication_method_request to COMPLETED
Set updated_at - now() (Get current date-time)
Set updated_by - user_id (Extract user from token)
Update mpi.person_authentication_method:
set ended_at = now() (Get current date-time)
action = update
validate auth_method_request.auth_method_current:
If auth_method_request.auth_method_current = OTP - Verificate sms (Invoke verification module to verify OTP (OTP Verification))
If auth_method_request.auth_method_current = OFFLINE - verificate download documents
Update authentication method request
Change entity status in IL_DB.authentication_method_request to COMPLETED
Set updated_at - now() (Get current date-time)
Set updated_by - user_id (Extract user from token)
Update mpi.person_authentication_method:
set
alias
(if it passed in request)
action = insert
validate auth_method_request.auth_method_current:
If auth_method_request.auth_method_current = OTP - Verificate sms (Invoke verification module to verify OTP (OTP Verification))
If auth_method_request.auth_method_current = OFFLINE - verificate download documents
If il.authentication_method_request.authentication_method.type =
OFFLINE
verificate download documents
if type =
THIRD_PERSON
, setvalue = il.authentication_method_request.authentication_method.value
alias = il.authentication_method_request.authentication_method.alias
Start date: start_date = Current_date()
End date:
Code Block if (person.age < 14) { end_date =birth_date + no_self_auth_age - 1d;} else { end_date = start_date + third_person_term;}
Update authentication method request
Change entity status in IL_DB.authentication_method_request to COMPLETED
Set updated_at - now() (Get current date-time)
Set updated_by - user_id (Extract user from token)
Update mpi.person_asuthentication_methods
If active il.authentication_method_request.authentication_method.type = OTP or OFFLINE or NA,
person’s auth method that was before becomes inactive - set
ended_at
= now() (Get current date-time)set new auth_method in person_auth_methods. Set fields -
type
,phone_numer
,alias
(if it is in request)
If il.authentication_method_request.authentication_method.type = THIRD_PERSON
Add to table
person_auth_methods
row with type =third_person
. Set fields -type
,value
,alias
,ended_at
,started_at
Processing
...
Send Person to verification process
...
If
$.authenticationMethod.type
=OFFLINE
and action =insert
then (
verification is neededSet
MPI.persons.verification_status
=VERIFICATION_NEEDED
andSet
MPI.persons.verification_reason = AUTO
andCreate
StateChangeEvent
in event manager with new verification status )
elseif
$.authenticationMethod.type
=OTP
and action =insert
andMPI.persons.verification_status
!=VERIFIED
then (
checking Rule 02-05if (Person's
age
>=no_self_auth_age
andno_tax_id
=true
) or
(Person'sage
>=no_self_auth_age
and Person’stax_id
is invalid: not match with birth date or gender or checksum) or
(Person’sage
<no_self_auth_age
and has document with typeBIRTH_CERTIFICATE_FOREIGN
) or (Person’sage
>=no_self_auth_age
and has document with typePERMANENT_RESIDENCE_PERMIT
) then
manual verification is neededSet
MPI.persons.verification_status
=VERIFICATION_NEEDED
andSet
MPI.persons.verification_reason
=RULES_TRIGGERED
andCreate StateChangeEvent in event manager with new verification status
else
person will be verified with RegistersSet
MPI.persons.verification_status
=VERIFICATION_NEEDED
andSet
MPI.persons.verification_reason
=RULES_PASSED
andSet
MPI.persons.verification_comment
=NULL
andCreate StateChangeEvent in event manager with new verification status
)
Response structure
...
See on Apiary
Example:
Expand | ||
---|---|---|
| ||
|
Expand | ||
---|---|---|
| ||
|
Post-processing processes*
API paragraph not found
HTTP status codes
...
Page Properties | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|