Verificar el código de MFA
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
}Verificar el código de MFA
Utiliza este endpoint para verificar el código de MFA introducido por el usuario durante la configuración. Debe llamarse después de iniciar la configuración y antes de habilitar MFA.
POST
/
v1
/
users
/
{id}
/
mfa
/
verify
Verificar el código de MFA
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
}Autorizaciones
El token de autorización en formato 'Bearer '.
Parámetros de ruta
Identificador único del usuario que deseas consultar.
Cuerpo
application/json
Información necesaria para verificar un código de MFA durante la configuración.
Código OTP que se desea verificar.
Required string length:
6 - 8Tipo de MFA que se está verificando.
Opciones disponibles:
app, email, sms Secreto TOTP (requerido para MFA basado en aplicación).
Código de país ISO 3166-1 alpha-2 (p. ej. "BR", "US"). Se usa para resolver el número de teléfono en MFA por SMS. No es un prefijo de marcado (+55).
Respuesta
Código de MFA verificado correctamente.
¿Esta página le ayudó?
⌘I

