Purpose
This method allows to find person's active authentication methods.
Specification
Authorization
Verify the validity of access token
Return (401, 'Invalid access token') in case of validation fails
Verify that token is not expired
in case of error - return (401, 'Invalid access token')
Check user scopes in order to perform this action (scope = 'authentication_method:read_pis')
Return (403, 'Your scope does not allow to access this resource. Missing allowances: authentication_method:read_pis') in case of invalid scope(s)
Check that token contains person_id
in case of error - return (401, 'Invalid access token')
Validate Person
Get person_id from token (x-person-id header)
Validate patient status is active (status = ‘active' & is_active = 'true’)
in case of error - return 404 ('not found')
Service logic
Service returns authentication method for person
Get active (person_authentication_methods.ended_at > now() and is_active = 'true’) authentication method by person_id from person_authentication_methods
Return confidant_person block for THIRD_PERSON authentication method from by authentication_methods.value=confidant_person_relationship.confidant_person_id
In case confidant_person_relationship has no records don’t show the confidant_person block