Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. if type = OTP , phone_number is required and value shouldn’t be set. And field alias is optional.

  2. if type = OFFLINE , phone_numberand value shouldn’t be set . And field alias is optional.

  3. if type = THIRD_PERSON, value is required and phone_numbershouldn’t be set. And field alias is required. ,phone_number, alias are required.

  4. if type = THIRD_PERSON - Validate phone_number with mpi.person_auth_method.phone_number where mpi.person_auth_method.person_id = auth_method_request.authentication_method.value

  5. validate value:

    1. validate person.id is UUID

      • in case error return 422

    2. search person by person.id in MPI 

      • in case error return 422, "such person doesn't exist"

    3. search person by person.id in MPI 

      • in case error return 422, "third person must be active"

    4. search third_person.age > 18 years:

      • in case error return 422, "third person must be adult"

    5. validate third_person.auth_method !=N/A

      • in case error return 422, "third person must has auth method OTP or OFFLINE"

...

Set default auth method of person on IL.auth_method_request.auth_method_current - use function in mpi, that returm return default auth method.

Generate verification code

...

Invoke Initialize OTP to generate one time password and send it where auth_method_requests.auth_method_current = OTP. (Use function in mpi, that returm default auth method)

cURL example

Code Block
curl -X POST \
  http://localhost:4000/verifications \
  -H 'content-type: application/json' \
  -d '{
  "phone_number": "+380936235985"
}'

...