Iniciar configuración de MFA (TOTP)
POST
/auth/mfa/setup
const url = 'https://api.dev.lade.com.mx/auth/mfa/setup';const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
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://api.dev.lade.com.mx/auth/mfa/setup \ --header 'Authorization: Bearer <token>'Asocia un nuevo software token TOTP al usuario autenticado (Cognito AssociateSoftwareToken) y devuelve el secreto junto con una URL otpauth:// para generar el código QR en el frontend. El usuario debe confirmarlo después con /auth/mfa/verify.
Authorizations
Sección titulada «Authorizations»Responses
Sección titulada «Responses»Secreto TOTP generado
Media typeapplication/json
object
secret_code
string
qr_url
string format: uri
Example
{ "secret_code": "JBSWY3DPEHPK3PXP", "qr_url": "otpauth://totp/Lade%3Ausuario%40ejemplo.com?secret=JBSWY3DPEHPK3PXP&issuer=Lade"}No autenticado
Media typeapplication/json
object
error
required
string
message
string
field
string
Example
{ "error": "Unauthorized", "message": "Invalid or expired token"}