Verify MFA Passcode & Complete Login
curl --request POST \
--url https://api.example.com/api/identity/mfa/verify \
--header 'Content-Type: application/json' \
--data '
{
"mfa_token": "mfa_sess_tok_998877aabbcc",
"otp_code": "849201"
}
'import requests
url = "https://api.example.com/api/identity/mfa/verify"
payload = {
"mfa_token": "mfa_sess_tok_998877aabbcc",
"otp_code": "849201"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({mfa_token: 'mfa_sess_tok_998877aabbcc', otp_code: '849201'})
};
fetch('https://api.example.com/api/identity/mfa/verify', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/identity/mfa/verify",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'mfa_token' => 'mfa_sess_tok_998877aabbcc',
'otp_code' => '849201'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/identity/mfa/verify"
payload := strings.NewReader("{\n \"mfa_token\": \"mfa_sess_tok_998877aabbcc\",\n \"otp_code\": \"849201\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/api/identity/mfa/verify")
.header("Content-Type", "application/json")
.body("{\n \"mfa_token\": \"mfa_sess_tok_998877aabbcc\",\n \"otp_code\": \"849201\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/identity/mfa/verify")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"mfa_token\": \"mfa_sess_tok_998877aabbcc\",\n \"otp_code\": \"849201\"\n}"
response = http.request(request)
puts response.read_body{
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"refresh_token": "dGhpcy1pcy1hLXNlY3VyZS1yZWZyZXNo...",
"token_type": "bearer"
}{
"detail": "Invalid or expired OTP code"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authentication
Verify MFA Passcode & Complete Login
Overview
Validates the user-submitted OTP code against the active MFA session. Returns full access and refresh tokens upon success.
Authentication & Headers
- Auth: Public (Scoped to MFA challenge session token)
- Required Header:
API-Version: 1
Parameters & Request Body
mfa_token(string, required): The challenge session token.otp_code(string, required): The 6-digit verification code received by user.
POST
/
api
/
identity
/
mfa
/
verify
Verify MFA Passcode & Complete Login
curl --request POST \
--url https://api.example.com/api/identity/mfa/verify \
--header 'Content-Type: application/json' \
--data '
{
"mfa_token": "mfa_sess_tok_998877aabbcc",
"otp_code": "849201"
}
'import requests
url = "https://api.example.com/api/identity/mfa/verify"
payload = {
"mfa_token": "mfa_sess_tok_998877aabbcc",
"otp_code": "849201"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({mfa_token: 'mfa_sess_tok_998877aabbcc', otp_code: '849201'})
};
fetch('https://api.example.com/api/identity/mfa/verify', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/identity/mfa/verify",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'mfa_token' => 'mfa_sess_tok_998877aabbcc',
'otp_code' => '849201'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/identity/mfa/verify"
payload := strings.NewReader("{\n \"mfa_token\": \"mfa_sess_tok_998877aabbcc\",\n \"otp_code\": \"849201\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/api/identity/mfa/verify")
.header("Content-Type", "application/json")
.body("{\n \"mfa_token\": \"mfa_sess_tok_998877aabbcc\",\n \"otp_code\": \"849201\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/identity/mfa/verify")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"mfa_token\": \"mfa_sess_tok_998877aabbcc\",\n \"otp_code\": \"849201\"\n}"
response = http.request(request)
puts response.read_body{
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"refresh_token": "dGhpcy1pcy1hLXNlY3VyZS1yZWZyZXNo...",
"token_type": "bearer"
}{
"detail": "Invalid or expired OTP code"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}