Method
El Method Request es un paso opcional pero recomendado que permite al Access Control Server (ACS) del emisor recolectar información adicional del dispositivo del usuario.
Propósito
El Method Request permite:
- Recolectar información adicional del navegador en un iframe oculto
- Mejorar la evaluación de riesgo del emisor
- Aumentar la probabilidad de autenticación frictionless (sin challenge)
¿Cuándo se Realiza?
El Method Request solo se realiza si el Version Response incluye un threeds_method_url. Si este campo está vacío o no está presente, se omite este paso.
Función SendMethodRequest()
La librería JavaScript de Akua proporciona una función para enviar el Method Request:
function SendMethodRequest(threeDSMethodURL, threeDSServerTransID, methodNotificationURL) {
let frameContainer = document.getElementById('methodFrameContainer');
const threeDSMethodData = {
threeDSServerTransID: threeDSServerTransID,
threeDSMethodNotificationURL: methodNotificationURL
}
const threeDSMethodDataBase64 = encode(JSON.stringify(threeDSMethodData))
const methodIframeName = 'methodIframe'
const methodIframe = createIframe(frameContainer, methodIframeName, methodIframeName, 0, 0)
const methodForm = createForm('threeDSMethodForm', threeDSMethodURL, methodIframe.name)
const input = createInput('threeDSMethodData', threeDSMethodDataBase64)
methodForm.appendChild(input);
methodIframe.appendChild(methodForm);
methodForm.submit();
}URL de Notificación del Method Request
Debe implementar un endpoint en su servidor para recibir la notificación cuando el Method Request se complete. Por ejemplo:
https://su-dominio.com/api/3ds/method-notification
Este endpoint:
- Debe ser accesible públicamente (el ACS del emisor hará
POSTa esta URL) - Recibirá un parámetro
threeDSMethodDataen base64 URL-safe - Debe responder con
HTTP 200 - Debe notificar al frontend (via WebSocket, Server-Sent Events, o postMessage) que el método se completó
Formato del threeDSMethodData
El parámetro threeDSMethodData enviado al ACS es un objeto JSON codificado en base64 URL-safe:
{
"threeDSServerTransID": "8a880dc0-1234-5678-9abc-def012345678",
"threeDSMethodNotificationURL": "https://su-dominio.com/api/3ds/method-notification"
}Codificación Base64 URL-Safe
Es importante usar codificación base64 URL-safe, que reemplaza los caracteres especiales:
function encode(str) {
return btoa(str)
.replace(/\+/g, '-')
.replace(/\//g, '_')
.replace(/=/g, '')
}Campo threeds_comp_ind en Authenticate Request
⚠️ CAMPO REQUERIDO cuando device_channel = "02" (Browser)
Después del Method Request, debe incluir el campo threeds_comp_ind en el Authenticate Request:
"Y"- El Method Request se completó exitosamente"N"- El Method Request no se completó (timeout, error, o no había Method URL)
Importante: Este campo es obligatorio para flujos browser. Si no realizó un Method Request (porque no había threeds_method_url en el Version Response), debe enviar "N".
Timeout del Method Request
Se recomienda establecer un timeout de 10 segundos para el Method Request. Si el ACS no responde en ese tiempo, continúe con el flujo 3DS estableciendo threeds_comp_ind a "N".
Updated about 9 hours ago