Walkthrough
- Your system sees in
GET https://daas.masnet.com/api/v1/integrations/data/mp-gateway/executorsan executor withavailability = session_closedandsession_login_supported = true. - It creates the flow with that
executor_idand its currentsession_epoch. - It reads the flow with
Prefer: waituntil it asks forcredentials. It encrypts the national ID and password toward the prompt key and sends them. - The extension checks that the national ID is authorized, types it and requests the email code. The flow asks for
otp. - Your system obtains the code by its own means and sends it encrypted.
- If the account has more than one eligible company, the flow asks for
companyand your system chooses it. - The extension proves the session and the flow ends as
authenticated.
Requirements
- The same as the data plane: a production integration with
write:mp_gateway, a verified company and a paired Chrome executor. SESSION_LOGINamong the grant actions and each person national ID inallowed_login_ruts(up to 10). Granting it also requires the remote sign-in permission, a recent second factor and explicit confirmation: "The company system will be able to sign in to Mercado Público with the ClaveÚnica of these people".- The extension decrypts the national ID and compares it, normalized, with the list before typing it. A national ID outside the list ends the flow as
failedwithreason = login_rut_not_grantedwithout touching the portal. - The executor with the session closed and no other intent or flow running. A flow never overwrites an active session.
The flow travels through the Integrations API, not through the company server: it does not depend on data_plane_origin.
Routes
| Method | Path | Use |
|---|---|---|
POST | /data/mp-gateway/session-flows | Creates the flow and wakes the executor. Answers 202 with the flow. Idempotent by client_request_id. |
GET | /data/mp-gateway/session-flows/{flowId} | State, required_input and current prompt with receiver_key_id and public_jwk. Accepts Prefer: wait=N (N from 1 to 20): answers earlier if version changes. |
POST | /data/mp-gateway/session-flows/{flowId}/inputs | One encrypted envelope (credentials or otp). Answers 202. Body of at most 8 KiB, rejected before reading it. |
POST | /data/mp-gateway/session-flows/{flowId}/actions | resend_otp or select_company. |
POST | /data/mp-gateway/session-flows/{flowId}/cancel | Stops the next steps and deletes envelopes and keys. It does not undo a sign-in already accepted. |
All require write:mp_gateway and SESSION_LOGIN in the grant, and answer with Cache-Control: no-store.
POST https://daas.masnet.com/api/v1/integrations/data/mp-gateway/session-flows
Authorization: Bearer <token>
Content-Type: application/json
{
"client_request_id": "11111111-1111-4111-8111-111111111111",
"executor_id": "22222222-2222-4222-8222-222222222222",
"expected_session_epoch": 3,
"auth_method": "clave_unica"
}expected_session_epochis thesession_epochyou read from the executor. If it changed, the session changed meanwhile: read the executor again.- With the session open it answers
409 MP_DIRECT_SESSION_ACTIVE: use the current session or close it first withSESSION_LOGOUT. - 3 flows every 15 minutes per executor are accepted, the account protection against portal lockout. The fourth answers
429 MP_DIRECT_SESSION_FLOW_LIMITwithRetry-After.
Read the flow
Read GET https://daas.masnet.com/api/v1/integrations/data/mp-gateway/session-flows/{flowId} with Prefer: wait=20: the response arrives as soon as version changes, or after 20 seconds without changes. required_input says what the flow waits for: none, credentials, otp or company.
state | Meaning |
|---|---|
queued | Created; the executor has not taken it yet. |
opening | The extension opens ClaveÚnica on the Chrome executor. |
awaiting_credentials | Waits for the encrypted national ID and password (required_input = credentials), up to 180 s. |
submitting_credentials | The extension types the national ID and password in ClaveÚnica. |
requesting_otp | The extension requests the code ClaveÚnica sends by email. |
awaiting_otp | Waits for the encrypted code (required_input = otp), up to 15 minutes. |
submitting_otp | The extension types the code. |
awaiting_company | Waits for your system to choose the company (required_input = company). |
verifying | The extension proves the open session and the company. |
recovering | The extension recovers from a restart or an unexpected screen. Keep waiting. |
authenticated | Session open in the company of the verified tax ID. The executor moves to session_state = active. |
local_interaction_required | The portal asks for something only a person at that Chrome can solve. The flow does not continue. |
failed | Ended without a session. reason says why. |
cancelled | Your system cancelled it. |
expired | The flow deadline expired (15 minutes). |
revoked | The executor was revoked or the grant was withdrawn. |
Reasons
reason | Meaning |
|---|---|
none | No reason: the flow continues or ended well. |
credential_rejected | ClaveÚnica rejected the national ID or password. |
otp_rejected | The portal rejected the code. |
portal_timeout | The portal did not answer in time. |
portal_drift | The portal showed a screen the extension does not recognize. |
input_expired | The data did not arrive within its deadline. |
key_lost | The Chrome executor lost the prompt key (for example, when restarting). Create a new flow. |
captcha | The portal asked for a captcha. |
password_change | ClaveÚnica asks to change the password. |
unsupported_challenge | The portal asked for a challenge the extension does not support. |
identity_mismatch | The open session does not match the expected national ID or tax ID. |
company_blocked | The company of the verified tax ID is not among the eligible companies of the account. |
session_changed | The portal session changed during the flow. |
device_offline | The executor disconnected. |
grant_revoked | The grant or the SESSION_LOGIN action was withdrawn. |
login_rut_not_granted | The national ID is not among the authorized national IDs of the grant. The extension did not touch the portal. |
Encrypt national ID and password
When required_input is credentials or otp, the prompt carries prompt_id, generation, portal_context_ref, receiver_key_id and public_jwk, the ephemeral P-256 public key of the Chrome executor for that step. Encrypt as follows, with a new sender key per envelope:
- AAD: the compact JSON, in UTF-8, of the array
[aad_protocol, flow_id, executor_id, registration_epoch, login_epoch, prompt_id, prompt_generation, kind, receiver_key_id, portal_context_ref]in that order, withaad_protocol = "mp-gateway.direct-session-secret.v1",prompt_generationequal toprompt.generationand the epochs as JSON integers. - Generate an ephemeral P-256 pair and derive the ECDH secret with
public_jwk. - Derive the key with HKDF-SHA-256: random 32 byte salt,
infoequal to the AAD bytes, 32 bytes of output. - Encrypt with AES-256-GCM: random 12 byte IV, 16 byte tag and the AAD as additional data.
- Plaintext:
{"username":"<national ID>","password":"<password>"}forcredentialsor{"otp":"<code>"}forotp, with no other fields. Send the national ID without dots and with a hyphen before the check digit (12345678-5), the form used by the Masnet remote sign-in. salt,ivandciphertext(ciphertext followed by the tag, up to 4096 bytes) go in unpadded base64url;sender_public_jwkcarries onlykty,crv,xandy.
{
"client_input_id": "66666666-6666-4666-8660-666666666666",
"expected_version": 7,
"prompt_id": "33333333-3333-4333-8333-333333333333",
"prompt_generation": 3,
"kind": "credentials",
"portal_context_ref": "55555555-5555-4555-8555-555555555555",
"envelope": {
"alg": "ECDH-P256-HKDF-SHA256-A256GCM",
"receiver_key_id": "44444444-4444-4444-8444-444444444444",
"sender_public_jwk": {
"kty": "EC",
"crv": "P-256",
"x": "x7LndVkLBdm1rzt1aND7g2KCNhJV7aoyphLkYxikNPY",
"y": "4hhCME6-Zxjv89e4N-thktW-8OF-Axl5uXYs5G0YpUI"
},
"salt": "l6FoVrBBaNWLYv9Y-4DxWz-szViI8aAC4wSfHwAx1H4",
"iv": "TkLPaKOEDQbd-pht",
"ciphertext": "vR3BHjWyny5oGWSgCqfaOEZnkNU1PxLRBO8DI1iPo_uDZvOKadtjAFrD37R-E0gdmn4XOS3ycdH1p18bVvGzuDzP7GyUNw"
}
}| Field | Required | Rule | Use |
|---|---|---|---|
client_input_id | Yes | Text matching ^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$ | UUID v4 you generate. Repeating it with another envelope answers 409 MP_DIRECT_IDEMPOTENCY_CONFLICT. |
expected_version | Yes | Integer from 0 up to 9007199254740991 | The flow version you read. |
prompt_id | Yes | Text matching ^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$ | prompt.prompt_id. |
prompt_generation | Yes | Integer from 0 up to 9007199254740991 | prompt.generation. |
kind | Yes | credentials, otp | credentials or otp, equal to prompt.kind. |
portal_context_ref | Yes | Text matching ^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$ | prompt.portal_context_ref. |
envelope | Yes | Object | The encrypted envelope. |
- If the prompt or the version are no longer current, it answers
409 MP_DIRECT_SESSION_FLOW_STALE: read the flow again and encrypt for the current prompt. An envelope encrypted for another prompt cannot be reused. - The envelope is delivered once to the extension and Masnet deletes it after 60 s at most. Never send plaintext: the API rejects it.
- Encrypt in memory and do not keep the plaintext or the envelope in logs.
Email code
- After typing the national ID and password, the extension requests the code once and the flow moves to
awaiting_otp. Your system obtains it from the person mailbox by its own means, encrypts it toward the newotpprompt and sends it like the credentials. - To request another code, send
resend_otptoPOST https://daas.masnet.com/api/v1/integrations/data/mp-gateway/session-flows/{flowId}/actions: up to 2 times per flow and 5 minutes after the last code. - Masnet does not read mailboxes or request codes on its own.
{
"client_action_id": "77777777-7777-4777-8777-777777777777",
"expected_version": 5,
"action": "resend_otp"
}Choose the company
The session is limited to the verified tax ID of the integration. With a single eligible and identified company, the extension chooses it without asking. If there is more than one, or the only one is not identified, the flow moves to awaiting_company with required_input = company and choices: each option carries choice_ref, label, version and eligible.
{
"client_action_id": "88888888-8888-4888-8888-888888888888",
"expected_version": 9,
"action": "select_company",
"choice_ref": "99999999-9999-4999-8999-999999999999",
"choice_version": 1
}Choose only an option with eligible = true, with its choice_ref and its version as choice_version.
Cancel
POST https://daas.masnet.com/api/v1/integrations/data/mp-gateway/session-flows/{flowId}/cancel with client_action_id and expected_version stops the next steps and deletes the flow envelopes and keys. It does not close a session the portal already accepted: for that, SESSION_LOGOUT.
Errors
They answer application/json with { "error": "MP_DIRECT_...", "detail": "...", "request_id": "...", "retry_after_seconds": 120 }. Authentication, scopes and the per minute quota answer in application/problem+json, like the rest of the API.
| Code | HTTP | Cause |
|---|---|---|
MP_DIRECT_COMPANY_UNVERIFIED | 403 | The company does not have a verified tax ID (tin_status = verified) in Masnet. |
MP_DIRECT_ACTION_NOT_GRANTED | 403 | The action is not in allowed_actions of the current mp_gateway grant, or the credential belongs to a test integration and the action writes to Mercado Público. |
MP_DIRECT_EXECUTOR_OFFLINE | 503 | The chosen Chrome executor has not reported recent presence or is offline. |
MP_DIRECT_EXECUTOR_BUSY | 409 | The executor already has another active intent. |
MP_DIRECT_IDEMPOTENCY_CONFLICT | 409 | client_request_id reused with a different body. |
MP_DIRECT_SESSION_ACTIVE | 409 | The executor already has a Mercado Público session. A session flow does not overwrite it: use the current one or close it first with SESSION_LOGOUT. |
MP_DIRECT_SESSION_FLOW_LIMIT | 429 | 3 session flows in 15 minutes were reached on that executor, the account protection against portal lockout inherited from remote sign-in. Includes Retry-After. |
MP_DIRECT_SESSION_FLOW_STALE | 409 | expected_version, prompt_id or prompt_generation are no longer current. Read the flow again and answer the current prompt. |
Reference implementation
Node.js 18 or later, without dependencies. sealLoginInput(flow, secret) takes the response of GET .../session-flows/{flowId} and returns the body of POST .../inputs.
// Sobre cifrado del session flow del gateway de Mercado Público (mp-gateway.direct-data-plane.v1, sección session_flows).
// Node.js 18 o superior, sin dependencias: Web Crypto de node:crypto.
//
// El sistema de la empresa cifra RUN y clave, o el código del correo, hacia la clave pública efímera del prompt vigente.
// Masnet no puede descifrar el sobre: solo lo entrega una vez al Chrome ejecutor, dueño de la clave privada.
import { webcrypto } from 'node:crypto'
const { subtle } = webcrypto
export const AAD_PROTOCOL = 'mp-gateway.direct-session-secret.v1'
export const ALG = 'ECDH-P256-HKDF-SHA256-A256GCM'
const MAX_CIPHERTEXT_BYTES = 4096
const b64u = (bytes) => Buffer.from(bytes).toString('base64url')
/**
* AAD canónico: JSON compacto del arreglo en el orden de session_flows.aad_fields, epochs y generación como enteros, en UTF-8.
* `flow` es la respuesta de GET /session-flows/{flowId} con su prompt vigente.
*/
export function sessionAad(flow) {
const prompt = flow.prompt
return new TextEncoder().encode(JSON.stringify([
AAD_PROTOCOL,
flow.flow_id,
flow.executor_id,
flow.registration_epoch,
flow.login_epoch,
prompt.prompt_id,
prompt.generation,
prompt.kind,
prompt.receiver_key_id,
prompt.portal_context_ref,
]))
}
/** Texto claro cerrado: {"username","password"} para credentials y {"otp"} para otp, con los límites del contrato. */
function plaintextFor(kind, secret) {
if (kind === 'credentials') {
const { username, password } = secret
if (typeof username !== 'string' || username.length < 1 || username.length > 128) throw new Error('username fuera de rango')
if (typeof password !== 'string' || password.length < 1 || password.length > 1024) throw new Error('password fuera de rango')
return JSON.stringify({ username, password })
}
if (typeof secret.otp !== 'string' || secret.otp.length < 1 || secret.otp.length > 64) throw new Error('otp fuera de rango')
return JSON.stringify({ otp: secret.otp })
}
/**
* Arma el cuerpo de POST /session-flows/{flowId}/inputs para el prompt vigente del flujo.
*
* `options.senderPrivateJwk`, `options.salt` e `options.iv` existen solo para reproducir los vectores de prueba.
* En producción no los pase: la clave emisora, el salt y el IV deben ser aleatorios y nuevos en cada sobre.
*/
export async function sealLoginInput(flow, secret, options = {}) {
const prompt = flow.prompt
if (!prompt || (prompt.kind !== 'credentials' && prompt.kind !== 'otp')) throw new Error('el flujo no pide un dato cifrado')
if (flow.required_input !== prompt.kind) throw new Error('required_input no coincide con el prompt')
const aad = sessionAad(flow)
const plaintext = new TextEncoder().encode(plaintextFor(prompt.kind, secret))
try {
const receiver = await subtle.importKey('jwk', { kty: 'EC', crv: 'P-256', x: prompt.public_jwk.x, y: prompt.public_jwk.y },
{ name: 'ECDH', namedCurve: 'P-256' }, false, [])
const sender = options.senderPrivateJwk
? {
privateKey: await subtle.importKey('jwk', { kty: 'EC', crv: 'P-256', ...options.senderPrivateJwk }, { name: 'ECDH', namedCurve: 'P-256' }, false, ['deriveBits']),
publicJwk: { kty: 'EC', crv: 'P-256', x: options.senderPrivateJwk.x, y: options.senderPrivateJwk.y },
}
: await (async () => {
const pair = await subtle.generateKey({ name: 'ECDH', namedCurve: 'P-256' }, true, ['deriveBits'])
const { x, y } = await subtle.exportKey('jwk', pair.publicKey)
return { privateKey: pair.privateKey, publicJwk: { kty: 'EC', crv: 'P-256', x, y } }
})()
const shared = await subtle.deriveBits({ name: 'ECDH', public: receiver }, sender.privateKey, 256)
const salt = options.salt ?? webcrypto.getRandomValues(new Uint8Array(32))
const iv = options.iv ?? webcrypto.getRandomValues(new Uint8Array(12))
const hkdf = await subtle.importKey('raw', shared, 'HKDF', false, ['deriveKey'])
const key = await subtle.deriveKey({ name: 'HKDF', hash: 'SHA-256', salt, info: aad }, hkdf, { name: 'AES-GCM', length: 256 }, false, ['encrypt'])
const sealed = new Uint8Array(await subtle.encrypt({ name: 'AES-GCM', iv, additionalData: aad, tagLength: 128 }, key, plaintext))
new Uint8Array(shared).fill(0)
if (sealed.byteLength > MAX_CIPHERTEXT_BYTES) throw new Error('sobre demasiado grande')
return {
client_input_id: options.clientInputId ?? webcrypto.randomUUID(),
expected_version: flow.version,
prompt_id: prompt.prompt_id,
prompt_generation: prompt.generation,
kind: prompt.kind,
portal_context_ref: prompt.portal_context_ref,
envelope: {
alg: ALG,
receiver_key_id: prompt.receiver_key_id,
sender_public_jwk: sender.publicJwk,
salt: b64u(salt),
iv: b64u(iv),
ciphertext: b64u(sealed),
},
}
} finally {
plaintext.fill(0)
}
}Python 3.9 or later with cryptography. seal_login_input(flow, secret) does the same.
# Sobre cifrado del session flow del gateway de Mercado Público (mp-gateway.direct-data-plane.v1, sección session_flows).
# Python 3.9 o superior con el paquete cryptography (pip install cryptography).
#
# El sistema de la empresa cifra RUN y clave, o el código del correo, hacia la clave pública efímera del prompt vigente.
# Masnet no puede descifrar el sobre: solo lo entrega una vez al Chrome ejecutor, dueño de la clave privada.
import base64
import json
import os
import uuid
from cryptography.hazmat.primitives import hashes
from cryptography.hazmat.primitives.asymmetric import ec
from cryptography.hazmat.primitives.ciphers.aead import AESGCM
from cryptography.hazmat.primitives.kdf.hkdf import HKDF
AAD_PROTOCOL = "mp-gateway.direct-session-secret.v1"
ALG = "ECDH-P256-HKDF-SHA256-A256GCM"
MAX_CIPHERTEXT_BYTES = 4096
def b64u(data):
return base64.urlsafe_b64encode(data).rstrip(b"=").decode("ascii")
def b64u_decode(text):
return base64.urlsafe_b64decode(text + "=" * (-len(text) % 4))
def session_aad(flow):
"""AAD canónico: JSON compacto del arreglo en el orden de session_flows.aad_fields, en UTF-8."""
prompt = flow["prompt"]
fields = [
AAD_PROTOCOL,
flow["flow_id"],
flow["executor_id"],
flow["registration_epoch"],
flow["login_epoch"],
prompt["prompt_id"],
prompt["generation"],
prompt["kind"],
prompt["receiver_key_id"],
prompt["portal_context_ref"],
]
return json.dumps(fields, separators=(",", ":"), ensure_ascii=False).encode("utf-8")
def plaintext_for(kind, secret):
if kind == "credentials":
username, password = secret["username"], secret["password"]
if not 1 <= len(username) <= 128 or not 1 <= len(password) <= 1024:
raise ValueError("username o password fuera de rango")
body = {"username": username, "password": password}
else:
otp = secret["otp"]
if not 1 <= len(otp) <= 64:
raise ValueError("otp fuera de rango")
body = {"otp": otp}
return json.dumps(body, separators=(",", ":"), ensure_ascii=False).encode("utf-8")
def public_key_from_jwk(jwk):
x = int.from_bytes(b64u_decode(jwk["x"]), "big")
y = int.from_bytes(b64u_decode(jwk["y"]), "big")
return ec.EllipticCurvePublicNumbers(x, y, ec.SECP256R1()).public_key()
def jwk_from_public_key(key):
numbers = key.public_numbers()
return {"kty": "EC", "crv": "P-256", "x": b64u(numbers.x.to_bytes(32, "big")), "y": b64u(numbers.y.to_bytes(32, "big"))}
def seal_login_input(flow, secret, sender_private_d=None, salt=None, iv=None, client_input_id=None):
"""Arma el cuerpo de POST /session-flows/{flowId}/inputs para el prompt vigente del flujo.
sender_private_d, salt e iv existen solo para reproducir los vectores de prueba. En producción no los pase:
la clave emisora, el salt y el IV deben ser aleatorios y nuevos en cada sobre.
"""
prompt = flow.get("prompt") or {}
kind = prompt.get("kind")
if kind not in ("credentials", "otp"):
raise ValueError("el flujo no pide un dato cifrado")
if flow["required_input"] != kind:
raise ValueError("required_input no coincide con el prompt")
aad = session_aad(flow)
plaintext = plaintext_for(kind, secret)
receiver = public_key_from_jwk(prompt["public_jwk"])
if sender_private_d is None:
sender = ec.generate_private_key(ec.SECP256R1())
else:
sender = ec.derive_private_key(int.from_bytes(b64u_decode(sender_private_d), "big"), ec.SECP256R1())
shared = sender.exchange(ec.ECDH(), receiver)
salt = salt if salt is not None else os.urandom(32)
iv = iv if iv is not None else os.urandom(12)
key = HKDF(algorithm=hashes.SHA256(), length=32, salt=salt, info=aad).derive(shared)
sealed = AESGCM(key).encrypt(iv, plaintext, aad)
if len(sealed) > MAX_CIPHERTEXT_BYTES:
raise ValueError("sobre demasiado grande")
return {
"client_input_id": client_input_id or str(uuid.uuid4()),
"expected_version": flow["version"],
"prompt_id": prompt["prompt_id"],
"prompt_generation": prompt["generation"],
"kind": kind,
"portal_context_ref": prompt["portal_context_ref"],
"envelope": {
"alg": ALG,
"receiver_key_id": prompt["receiver_key_id"],
"sender_public_jwk": jwk_from_public_key(sender.public_key()),
"salt": b64u(salt),
"iv": b64u(iv),
"ciphertext": b64u(sealed),
},
}Test vectors
With the fixed sender key, salt and IV of each vector, your implementation must produce exactly the same aad_hex and the same input body. The receiver private key lets you check that the envelope decrypts to the plaintext. Both reference implementations reproduce these vectors, and an independent decryption returns the plaintext.
{
"protocol": "mp-gateway.direct-data-plane.v1",
"aad_protocol": "mp-gateway.direct-session-secret.v1",
"note": "Claves, salt e IV de prueba, fijos para reproducir el resultado. En producción la clave emisora, el salt y el IV son aleatorios y nuevos en cada sobre, y la clave privada receptora vive solo en el Chrome ejecutor.",
"receiver_private_jwk": {
"kty": "EC",
"crv": "P-256",
"d": "GYqadG0zccHrdXrJl3EDjguNw4-C5Wmz7rButsP-e5s",
"x": "wOAT_KpKORUhsuquIXgQOsjDsTptzNuRcDIpI9ED1Co",
"y": "J5Lpa3vrGuD5p-DSNoipbjtdXVT8ocI7tJNfwE-9eV8"
},
"vectors": [
{
"name": "credentials",
"flow": {
"flow_id": "11111111-1111-4111-8111-111111111111",
"executor_id": "22222222-2222-4222-8222-222222222222",
"registration_epoch": 1,
"login_epoch": 2,
"version": 7,
"auth_method": "clave_unica",
"expires_at": "2026-12-02T15:15:00Z",
"actual_session_state": "logged_out",
"reason": "none",
"state": "awaiting_credentials",
"required_input": "credentials",
"prompt": {
"prompt_id": "33333333-3333-4333-8333-333333333333",
"generation": 3,
"kind": "credentials",
"portal_context_ref": "55555555-5555-4555-8555-555555555555",
"expires_at": "2026-12-02T15:03:00Z",
"receiver_key_id": "44444444-4444-4444-8444-444444444444",
"public_jwk": {
"kty": "EC",
"crv": "P-256",
"x": "wOAT_KpKORUhsuquIXgQOsjDsTptzNuRcDIpI9ED1Co",
"y": "J5Lpa3vrGuD5p-DSNoipbjtdXVT8ocI7tJNfwE-9eV8"
}
}
},
"secret": {
"username": "12345678-5",
"password": "prueba-vector-1"
},
"plaintext_utf8": "{\"username\":\"12345678-5\",\"password\":\"prueba-vector-1\"}",
"sender_private_jwk": {
"kty": "EC",
"crv": "P-256",
"d": "MoJ0Y_BHanyxjK4qsG91_r7F1Ac5OqLPmVoiZJp4c3k",
"x": "x7LndVkLBdm1rzt1aND7g2KCNhJV7aoyphLkYxikNPY",
"y": "4hhCME6-Zxjv89e4N-thktW-8OF-Axl5uXYs5G0YpUI"
},
"salt": "l6FoVrBBaNWLYv9Y-4DxWz-szViI8aAC4wSfHwAx1H4",
"iv": "TkLPaKOEDQbd-pht",
"aad_utf8": "[\"mp-gateway.direct-session-secret.v1\",\"11111111-1111-4111-8111-111111111111\",\"22222222-2222-4222-8222-222222222222\",1,2,\"33333333-3333-4333-8333-333333333333\",3,\"credentials\",\"44444444-4444-4444-8444-444444444444\",\"55555555-5555-4555-8555-555555555555\"]",
"aad_hex": "5b226d702d676174657761792e6469726563742d73657373696f6e2d7365637265742e7631222c2231313131313131312d313131312d343131312d383131312d313131313131313131313131222c2232323232323232322d323232322d343232322d383232322d323232323232323232323232222c312c322c2233333333333333332d333333332d343333332d383333332d333333333333333333333333222c332c2263726564656e7469616c73222c2234343434343434342d343434342d343434342d383434342d343434343434343434343434222c2235353535353535352d353535352d343535352d383535352d353535353535353535353535225d",
"input": {
"client_input_id": "66666666-6666-4666-8660-666666666666",
"expected_version": 7,
"prompt_id": "33333333-3333-4333-8333-333333333333",
"prompt_generation": 3,
"kind": "credentials",
"portal_context_ref": "55555555-5555-4555-8555-555555555555",
"envelope": {
"alg": "ECDH-P256-HKDF-SHA256-A256GCM",
"receiver_key_id": "44444444-4444-4444-8444-444444444444",
"sender_public_jwk": {
"kty": "EC",
"crv": "P-256",
"x": "x7LndVkLBdm1rzt1aND7g2KCNhJV7aoyphLkYxikNPY",
"y": "4hhCME6-Zxjv89e4N-thktW-8OF-Axl5uXYs5G0YpUI"
},
"salt": "l6FoVrBBaNWLYv9Y-4DxWz-szViI8aAC4wSfHwAx1H4",
"iv": "TkLPaKOEDQbd-pht",
"ciphertext": "vR3BHjWyny5oGWSgCqfaOEZnkNU1PxLRBO8DI1iPo_uDZvOKadtjAFrD37R-E0gdmn4XOS3ycdH1p18bVvGzuDzP7GyUNw"
}
}
},
{
"name": "otp",
"flow": {
"flow_id": "11111111-1111-4111-8111-111111111111",
"executor_id": "22222222-2222-4222-8222-222222222222",
"registration_epoch": 1,
"login_epoch": 2,
"version": 7,
"auth_method": "clave_unica",
"expires_at": "2026-12-02T15:15:00Z",
"actual_session_state": "logged_out",
"reason": "none",
"state": "awaiting_otp",
"required_input": "otp",
"prompt": {
"prompt_id": "33333333-3333-4333-8333-333333333333",
"generation": 3,
"kind": "otp",
"portal_context_ref": "55555555-5555-4555-8555-555555555555",
"expires_at": "2026-12-02T15:03:00Z",
"receiver_key_id": "44444444-4444-4444-8444-444444444444",
"public_jwk": {
"kty": "EC",
"crv": "P-256",
"x": "wOAT_KpKORUhsuquIXgQOsjDsTptzNuRcDIpI9ED1Co",
"y": "J5Lpa3vrGuD5p-DSNoipbjtdXVT8ocI7tJNfwE-9eV8"
}
}
},
"secret": {
"otp": "0A7K2P"
},
"plaintext_utf8": "{\"otp\":\"0A7K2P\"}",
"sender_private_jwk": {
"kty": "EC",
"crv": "P-256",
"d": "6meiRfWKUOdRf5h--FGd585RU-NIXY9lJsvmu6d-8-w",
"x": "2Ifi2kS_dMW3khahEmBXLfb_spva8Zuim2X5iTm2Z8k",
"y": "tSHzoPjyVV5OSHBSZLAXR55QYZ9MTTomR9c1X5dJrd4"
},
"salt": "bCgqQ-tp1ucrNh7xBdItt-umEUIU_7ENGWjDbxYZb5k",
"iv": "O0NL3m9qhqkBk17W",
"aad_utf8": "[\"mp-gateway.direct-session-secret.v1\",\"11111111-1111-4111-8111-111111111111\",\"22222222-2222-4222-8222-222222222222\",1,2,\"33333333-3333-4333-8333-333333333333\",3,\"otp\",\"44444444-4444-4444-8444-444444444444\",\"55555555-5555-4555-8555-555555555555\"]",
"aad_hex": "5b226d702d676174657761792e6469726563742d73657373696f6e2d7365637265742e7631222c2231313131313131312d313131312d343131312d383131312d313131313131313131313131222c2232323232323232322d323232322d343232322d383232322d323232323232323232323232222c312c322c2233333333333333332d333333332d343333332d383333332d333333333333333333333333222c332c226f7470222c2234343434343434342d343434342d343434342d383434342d343434343434343434343434222c2235353535353535352d353535352d343535352d383535352d353535353535353535353535225d",
"input": {
"client_input_id": "66666666-6666-4666-8661-666666666666",
"expected_version": 7,
"prompt_id": "33333333-3333-4333-8333-333333333333",
"prompt_generation": 3,
"kind": "otp",
"portal_context_ref": "55555555-5555-4555-8555-555555555555",
"envelope": {
"alg": "ECDH-P256-HKDF-SHA256-A256GCM",
"receiver_key_id": "44444444-4444-4444-8444-444444444444",
"sender_public_jwk": {
"kty": "EC",
"crv": "P-256",
"x": "2Ifi2kS_dMW3khahEmBXLfb_spva8Zuim2X5iTm2Z8k",
"y": "tSHzoPjyVV5OSHBSZLAXR55QYZ9MTTomR9c1X5dJrd4"
},
"salt": "bCgqQ-tp1ucrNh7xBdItt-umEUIU_7ENGWjDbxYZb5k",
"iv": "O0NL3m9qhqkBk17W",
"ciphertext": "_tAAoUSeyPamn64XhNQAd2rnllHRNw0ET--pZZ00uQ0"
}
}
}
]
}