Canceling an MFA Request

Cease a previously initiated MFA request using HyperID's cancellation API

There might be cases when the application determines that the previously initiated MFA request is no longer needed and should be canceled.

To cancel an MFA request in HyperID, services should send a POST request to the HyperID API, requiring the 'mfa-client' scope, which must be explicitly granted by the user during the authorization process.

Request
POST /mfa-client/transaction/cancel HTTP/1.1
Host: api.hypersecureid.com
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6ImFjZDc0NGMzLWFlZDMtNGQxMC04ODZhLTcyYjU0MGY4NmU5YSJ9.eyJleHAiOjE2Nzk4MjM1NTEsImlhdCI6MTY3OTgxOTk1MSwiYXV0aF90aW1lIjoxNjc5ODE5OTUxLCJqdGkiOiIzM2ZlNzI2Ni1kOTY2LTRlNDgtYjU2My05ZWNhZTdjMWU3NTEiLCJpc3MiOiJodHRwczovL2xvZ2luLmh5cGVyc2VjdXJlaWQuY29tL2F1dGgvcmVhbG1zL0h5cGVySUQiLCJzdWIiOiI5MTZlMGUyZS00NmQ5LTRiODAtODg1Ni1kZDlmZWRiMWI3MjMiLCJ0eXAiOiJCZWFyZXIiLCJhenAiOiJjbGllbnQtc2VydmljZS1hcHAiLCJzY29wZSI6Im9wZW5pZCBlbWFpbCBrZXlzIGF1dGgiLCJzaWQiOiI5OTVjNzhhZC1lYmFjLTRhYWYtOTdiZC0xOTQ4ZWMxOWQzNzEiLCJ3YWxsZXRfYWRkcmVzcyI6IjB44oCmIiwid2FsbGV0X2NoYWluX2lkIjoiMSIsImVtYWlsX3ZlcmlmaWVkIjp0cnVlLCJlbWFpbCI6InVzZXJAZ21haWwuY29tIn0.h9GusuxDPX8VOjPoZHD73XzktOkVtd1qEz6C8AuBybw
Content-Length: 29

{
    "transaction_id": 3
}

The authorization header should include a valid and non-expired bearer (access) token.

The transaction_id should contain the same ID received during starting MFA request to identify the request being canceled.

HyperID will respond with a canceling result:

Response
HTTP/1.1 200 OK
Content-Type: application/json
{
    "result":       0
}

The result field is an integer representation of request result, with various possible values as listed in the table below:

Result ValueMeaning

0

Success

-1

Failure because the service is temporarily unavailable

-2

Failure due to invalid request parameters

-3

Failure due to access denial

-4

Failure due to an expired token

-5

Failure due to an invalid token

-6

Failure due to a transaction with the provided ID is not found

-8

Failure due to a transaction with the provided ID has already been expired

-9

Failure due to a transaction with the provided ID has already been completed

-10

Failure due to a transaction with the provided ID has already been canceled

Here are examples of the 'Cancel MFA Request' implemented:

curl --location 'http://api.hypersecureid.com/mfa-client/transaction/cancel' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJhMzQ3MzcyZS1mNjkwLTRiNmMtODQ4Yi0yY2I3NjM0NDdhNTMifQ.eyJleHAiOjE2OTM0MTE3OTEsImlhdCI6MTY5MzQwODE5MSwianRpIjoiODRmOWYwNzEtM2Q2Ni00NzIwLWI1YTQtZTNkZDIxZmY3ZDg2IiwiaXNzIjoiaHR0cHM6Ly9sb2dpbi1zdGFnZS5oeXBlcnNlY3VyZWlkLmNvbS9hdXRoL3JlYWxtcy9IeXBlcklEIiwic3ViIjoiNjRkODQ1NmQtZDc5My00NzVjLWE3YjUtMmM1OTk5ZWY0ZTllIiwidHlwIjoiQmVhcmVyIiwiYXpwIjoiYXBpLXRlc3QiLCJzZXNzaW9uX3N0YXRlIjoiZjk3YmU0Y2MtMWNlYS00MmQ3LTlhYjAtODY4MjQ1MGQwNDQ1IiwicmVnaW9uX2lkIjowLCJzY29wZSI6Im1mYS1hdXRoZW50aWNhdG9yIGVtYWlsIG1mYS1jbGllbnQiLCJzaWQiOiJmOTdiZTRjYy0xY2VhLTQyZDctOWFiMC04NjgyNDUwZDA0NDUiLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiZW1haWwiOiJ0ZXN0MTYwLnN0ZWFsdGhAb3V0bG9vay5jb20ifQ.PP3_HUBePmPb9WE3BXq7BzXhoH7pc9gsvIKn0MiFx7E' \
--data '{
    "transaction_id": 3
}'

Last updated