Starting an MFA Request

Initiate secure Multi-Factor Authentication (MFA) requests seamlessly with HyperID's API

When it comes to starting Multi-Factor Authentication (MFA) requests for specific user actions, services should send a POST request to the HyperID API, requiring the 'mfa-client' scope, which should be granted during the user's authorization process.

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

{
    "template_id": 1,
    "values": "",
    "code": "137",
    "device_id": "User device identifier",
    "device_desc": "User device description",
    "ip": "192.168.0.100"
}

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

The template_id and values parameters are responsible for shaping the user interface and content of the MFA request within the HyperID Authenticator App. For more comprehensive information, please refer corresponding chapter: MFA Request Templates.

The code optional parameter will appear in the confirmation request within the HyperID Authenticator App. Users must ensure that the code in the app matches the one provided by the client service.

The device_id, device_desc, and ip are optional string parameters, used to provide users with information about the device that initiated the MFA request.

Below, you can see examples of how this information appears in MFA requests inside the HyperID Authenticator App. The top section displays the condensed UI version (the default view), while the section below showcases the expanded view (detailed information):

Upon a successful request, HyperID will respond with a JSON object containing the transaction_id, which can be used to Check the MFA request status or Cancel the MFA request:

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

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

-7

Failure due to the user's device with HyperID Authenticator App not being found (you can check if the user has the corresponding device within the specific request)

-8

Failure due to specified template is not found

Here are examples of the 'Start MFA request' implemented:

curl --location 'http://api.hypersecureid.com/mfa-client/transaction/start/v2' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6ImFjZDc0NGMzLWFlZDMtNGQxMC04ODZhLTcyYjU0MGY4NmU5YSJ9.eyJleHAiOjE2Nzk4MjM1NTEsImlhdCI6MTY3OTgxOTk1MSwiYXV0aF90aW1lIjoxNjc5ODE5OTUxLCJqdGkiOiIzM2ZlNzI2Ni1kOTY2LTRlNDgtYjU2My05ZWNhZTdjMWU3NTEiLCJpc3MiOiJodHRwczovL2xvZ2luLmh5cGVyc2VjdXJlaWQuY29tL2F1dGgvcmVhbG1zL0h5cGVySUQiLCJzdWIiOiI5MTZlMGUyZS00NmQ5LTRiODAtODg1Ni1kZDlmZWRiMWI3MjMiLCJ0eXAiOiJCZWFyZXIiLCJhenAiOiJjbGllbnQtc2VydmljZS1hcHAiLCJzY29wZSI6Im9wZW5pZCBlbWFpbCBrZXlzIGF1dGgiLCJzaWQiOiI5OTVjNzhhZC1lYmFjLTRhYWYtOTdiZC0xOTQ4ZWMxOWQzNzEiLCJ3YWxsZXRfYWRkcmVzcyI6IjB44oCmIiwid2FsbGV0X2NoYWluX2lkIjoiMSIsImVtYWlsX3ZlcmlmaWVkIjp0cnVlLCJlbWFpbCI6InVzZXJAZ21haWwuY29tIn0.h9GusuxDPX8VOjPoZHD73XzktOkVtd1qEz6C8AuBybw' \
--data '{
    "template_id": 1,
    "values": "",
    "code": "137",
    "device_id": "User device identifier",
    "device_desc": "User device description",
    "ip": "192.168.0.100"
}'

Last updated