POST /auth/webauthn/login/finish
Valida a assinatura do authenticator e emite JWT + cookies (login normal).
- Access: Public
- Service:
https://auth-api.axuz.net
Accepted authentication
No authentication (public route, or protected by link/signature).
Valida a assinatura do authenticator e emite JWT + cookies (login normal).
Motivo: fecha o ceremony e faz login efetivo. Piso §3 — auth server-side; JWT emitido apenas após a library confirmar a assinatura contra a public key persistida. Comportamento: (1) decoda body {challenge_id, credential}; (2) loadChallenge (SessionData + user_id que foi salvo no begin); (3) reconstrói user com credentials atuais; (4) ValidateLogin da library; (5) UPDATE sign_count + last_used_at do credential; (6) writeFreshSession (JWT + cookies).
Entradas: body {challenge_id, credential (JSON do authenticator)}.
Retorno: 200 {id, email, name}; 401 challenge/credential inválido; 500 falha DB; 503 se webauthn desativado. Efeito: 1 SELECT + 1 DELETE (challenge) + 1 SELECT (creds) + 1 UPDATE (sign_count) + 1 INSERT (auth_refresh_tokens) + cookies.
Parameters
No parameters.
Request body
Corpo JSON. O schema detalhado deste endpoint ainda não está tipado na spec; veja a descrição da operação.
application/json
| Name | Type | Required | Description |
|---|---|---|---|
(corpo) | object | no |
{}Responses
200
{id, email, name}
401
Sem credencial valida
| Name | Type | Required | Description |
|---|---|---|---|
error | string | yes |
429
Limite de requisições excedido.
| Name | Type | Required | Description |
|---|---|---|---|
error | string | yes |
500
Falha DB
| Name | Type | Required | Description |
|---|---|---|---|
error | string | yes |
503
Se webauthn desativado. Efeito: 1 SELECT + 1 DELETE (challenge) + 1 SELECT (creds) + 1 UPDATE (sign_count) + 1 INSERT (auth_refresh_tokens) + cookies
| Name | Type | Required | Description |
|---|---|---|---|
error | string | yes |
Examples
"Try it" is turned off in this reference. Use the examples with your test credential.
curl
curl -sS -X POST 'https://auth-api.axuz.net/auth/webauthn/login/finish' \
-H "Content-Type: application/json" \
-d '{}'Node.js
const res = await fetch("https://auth-api.axuz.net/auth/webauthn/login/finish", {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({}),
});
if (!res.ok) throw new Error(`HTTP ${res.status}: ${await res.text()}`);
console.log(await res.json());Python
import os
import requests
res = requests.request(
"POST",
"https://auth-api.axuz.net/auth/webauthn/login/finish",
json={},
timeout=30,
)
res.raise_for_status()
print(res.json())