Answer a challenge from a device
const url = 'https://work.optidata.cloud/api/mfa/attempts/example';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"uuid":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","mfa_device_identifier":"example","mfa_pending_request_identifier":"example","data":"example","signature":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://work.optidata.cloud/api/mfa/attempts/example \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "uuid": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "mfa_device_identifier": "example", "mfa_pending_request_identifier": "example", "data": "example", "signature": "example" }'Confirms an open challenge by presenting a signature produced with the
device’s private key. The signed data must restate the challenge
identifier, the device identifier and the caller’s UUID; any mismatch, an
unconfirmed device, a device belonging to another user, or a challenge
that is no longer pending all fail with 422.
Authorizations
Section titled “Authorizations”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters”Public identifier of the challenge.
Request Bodyrequired
Section titled “Request Bodyrequired”object
UUID of the calling user.
Identifier of the device producing the proof.
Identifier of the challenge being answered.
The payload that was signed.
Signature of data under the device’s private key.
Examplegenerated
{ "uuid": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "mfa_device_identifier": "example", "mfa_pending_request_identifier": "example", "data": "example", "signature": "example"}Responses
Section titled “ Responses ”The challenge was approved.
object
object
Echo of the validated proof fields.
object
Examples
{ "success": true, "mfa_pending_request": { "identifier": "mfr_7cf1a9d2", "status": "approved" }}Missing, malformed or expired authentication key.
Authentication failures use an error key rather than message.
object
Examples
No bearer token sent
{ "error": "JWT passport exception: Missing bearer token in request"}The resource does not exist, or does not belong to the given drive.
Generic error envelope used by policy, binding and framework failures.
object
Human-readable description of the failure.
Examples
{ "message": "No query results for model [App\\Models\\Node] 99999999"}The request body or query string failed validation.
object
The first validation message.
Validation messages keyed by field name.
object
Examples
{ "message": "The name field is required.", "errors": { "name": [ "The name field is required." ] }}Rate limit exceeded. Retry after the window resets.
Generic error envelope used by policy, binding and framework failures.
object
Human-readable description of the failure.
Examples
{ "message": "Too Many Attempts."}