This process describes adding an additional authentication method to an existing person, update authentication method and delete it.
Table of Contents |
---|
Specification
...
Verify the validity of access token
Check user scope append_authauthentication_method:write in order to perform this action
...
Invoke Global parameters to get following parameter:
thirdphone_number_auth_limit
Check if in table person_authentication_methods with type = OTP
> N, then error 422, such a phone already exists more N times
confidant_person_limit
In table person_auth_methods with type = third_person > N, then error 422
...
|
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" } |
...
}
} |
if action = insert
Code Block |
---|
{
|
...
"$schema": "http://json-schema.org/draft-04/schema#", "type": |
...
"object", "properties": { "action": "insert", " |
...
authentication_methods": |
...
{ |
...
"type": "third_person", "value": "d12888c0-1159-4296-8f03-a592c136f673", |
...
"alias": "roksolana" } } |
...
} |
if action = update
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", |
...
|
...
" |
...
is_ |
...
primary" |
...
: "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"
...