...
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)
Logic
action = deactivate
If IL_DB.authentication_method_request.status = NEW
:
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)set
default
(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
Generate code or upload URL
If third_person.auth_method = OTP (Use function in mpi, that returm default auth method) - Invoke Initialize OTP to generate one time password and send it where auth_method_requests.third_person_auth_method_current = OTP.
If third_person.auth_method = OFFLINE (Use function in mpi, that returm default auth method) - Generate URL's with type person.{$.person_request.person.documents.[:].type} (or Generate URL's with type third_person.{$.third_person.documents.[:].type})
if type = OTP or OFFLINE, person’s auth method that was before (off or offline) becomes inactive
if type =
THIRD_PERSON
,set default=false
verificate download documents
if type =
THIRD_PERSON
, setdefault=false
value = 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 < 18) { end_date = min(birth_date + 18y - 1d, start_date + third_person_term);} else { end_date = start_date + third_person_term;}
If il.authentication_method_request.authentication_method.type = OFFLINE
...
Update authentication method request
Change entity status in IL_DB.authentication_method_request
...
- validate auth
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 il.authentication_method_request.
If auth_method_request.auth_method_current = OTP - Verificate sms (Invoke verification module to verify OTP (OTP Verification))
If authauthentication_method.type = OTP or OFFLINE,
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
,default
= TRUE,alias
(if it is in request)
If il.authentication_method_request.
authauthentication_method
_current = OFFLINE - verificate download documentsUpdate mpi
.type = THIRD_PERSON
Add to table
person_auth_methods
row with type =third_person
. Set fields -type
,value
,alias
,ended_at
,started_at
,default