Verify MFA Passcode
curl --request POST \
--url https://identity.sandbox.lerian.net/v1/users/{id}/mfa/verify \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"passcode": "123456",
"secret": "JBSWY3DPEHPK3PXP",
"mfaType": "app"
}
'import requests
url = "https://identity.sandbox.lerian.net/v1/users/{id}/mfa/verify"
payload = {
"passcode": "123456",
"secret": "JBSWY3DPEHPK3PXP",
"mfaType": "app"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({passcode: '123456', secret: 'JBSWY3DPEHPK3PXP', mfaType: 'app'})
};
fetch('https://identity.sandbox.lerian.net/v1/users/{id}/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://identity.sandbox.lerian.net/v1/users/{id}/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([
'passcode' => '123456',
'secret' => 'JBSWY3DPEHPK3PXP',
'mfaType' => 'app'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://identity.sandbox.lerian.net/v1/users/{id}/mfa/verify"
payload := strings.NewReader("{\n \"passcode\": \"123456\",\n \"secret\": \"JBSWY3DPEHPK3PXP\",\n \"mfaType\": \"app\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://identity.sandbox.lerian.net/v1/users/{id}/mfa/verify")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"passcode\": \"123456\",\n \"secret\": \"JBSWY3DPEHPK3PXP\",\n \"mfaType\": \"app\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://identity.sandbox.lerian.net/v1/users/{id}/mfa/verify")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"passcode\": \"123456\",\n \"secret\": \"JBSWY3DPEHPK3PXP\",\n \"mfaType\": \"app\"\n}"
response = http.request(request)
puts response.read_body{
"verified": true
}
Verify MFA Passcode
Use this endpoint to verify the MFA passcode entered by the user during setup. Must be called after initiating setup and before enabling MFA.
POST
/
v1
/
users
/
{id}
/
mfa
/
verify
Verify MFA Passcode
curl --request POST \
--url https://identity.sandbox.lerian.net/v1/users/{id}/mfa/verify \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"passcode": "123456",
"secret": "JBSWY3DPEHPK3PXP",
"mfaType": "app"
}
'import requests
url = "https://identity.sandbox.lerian.net/v1/users/{id}/mfa/verify"
payload = {
"passcode": "123456",
"secret": "JBSWY3DPEHPK3PXP",
"mfaType": "app"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({passcode: '123456', secret: 'JBSWY3DPEHPK3PXP', mfaType: 'app'})
};
fetch('https://identity.sandbox.lerian.net/v1/users/{id}/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://identity.sandbox.lerian.net/v1/users/{id}/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([
'passcode' => '123456',
'secret' => 'JBSWY3DPEHPK3PXP',
'mfaType' => 'app'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://identity.sandbox.lerian.net/v1/users/{id}/mfa/verify"
payload := strings.NewReader("{\n \"passcode\": \"123456\",\n \"secret\": \"JBSWY3DPEHPK3PXP\",\n \"mfaType\": \"app\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://identity.sandbox.lerian.net/v1/users/{id}/mfa/verify")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"passcode\": \"123456\",\n \"secret\": \"JBSWY3DPEHPK3PXP\",\n \"mfaType\": \"app\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://identity.sandbox.lerian.net/v1/users/{id}/mfa/verify")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"passcode\": \"123456\",\n \"secret\": \"JBSWY3DPEHPK3PXP\",\n \"mfaType\": \"app\"\n}"
response = http.request(request)
puts response.read_body{
"verified": true
}
Authorizations
The authorization token in the 'Bearer ' format.
Path Parameters
The unique identifier of the user you want to retrieve.
Body
application/json
Information required to verify an MFA passcode during setup.
The OTP passcode to verify.
Required string length:
6 - 8The type of MFA being verified.
Available options:
app, email, sms The TOTP secret (required for app-based MFA).
ISO 3166-1 alpha-2 country code (e.g. "BR", "US"). Used to resolve the phone number for SMS MFA. Not a dial prefix (+55).
Response
MFA passcode verified successfully.
Was this page helpful?
⌘I

