Enabling MFA
This section explains how to request a code and token to enable MFA for the specified user.
Request
POST https://<hostname>/api/v1/users/{id}/enableMfa |
Request Headers
The request header must contain an authorization token of the current session.
Request Parameters
The following parameters must be posted as URL.
Parameter | Description |
id | The identification number of the user. Can be obtained as described in Getting Users. |
Request Body
Property | Type | Description |
recreate | boolean | Sets if the account must be recreated. |
Request Example
Request: POST https://<hostname>/api/v1/users/1001/enableMfa
Request Header: Authorization: Bearer <Access-Token>
Request Header: { "recreate": true } |
Response
The server returns the following response to the client.
Response Codes
A successfully completed operation returns a response code 200 (OK).
Response Headers
The response to this request contains the following headers. The response may also include additional standard HTTPS headers.
Header | Description |
Content-length | The length of the response body. |
Content-type | The media type and syntax of the response body message: application/json; charset=utf-8 |
Response Body
The response contains the following information.
Property | Type | Description |
|---|---|---|
userId | integer | Shows the identification number of the user record. |
qrString | string | Shows the QR string. |
secretKey | string | Shows the secret key. |
scratchCodes | boolean | Shows the scratch codes. One if the codes must be specified as described in Accepting MFA. |
token | boolean | Shows the token. This value must be specified as described in Accepting MFA. |
Response Example
Request Header: Authorization: Bearer <Access-Token>
Response: 200 OK
Response Body: { "userId": 1001, "qrString": "otpauth://totp/Authentication&40?secret=KQ5P6HBW63UTX4JPMXBJXI2PQM&issuer=", "secretKey": "KQ5P6HBW63UTX4JPMXBJXI2PQM", "scratchCodes": [ "58189682", "89975527", "24259296", "35931094", "34317173" ], "token": "MEJDODYyQTQxMjZEQUMyMEJGMzMzRkY4OTQzRjY1REYwRjI0MTg4REU2RjhGMEUyQTg2NjE0MUIxNzg2NjNFNg==" } |