POST /auth/webauthn/login/finish
Valida a assinatura do authenticator e emite JWT + cookies (login normal).
- Acesso: Pública
- Serviço:
https://auth-api.axuz.net
Autenticação aceita
Sem autenticação (rota pública ou protegida por link/assinatura).
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.
Parâmetros
Sem parâmetros.
Corpo da requisição
Corpo JSON. O schema detalhado deste endpoint ainda não está tipado na spec; veja a descrição da operação.
application/json
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
(corpo) | object | não |
{}Respostas
200
{id, email, name}
401
Sem credencial valida
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
error | string | sim |
429
Limite de requisições excedido.
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
error | string | sim |
500
Falha DB
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
error | string | sim |
503
Se webauthn desativado. Efeito: 1 SELECT + 1 DELETE (challenge) + 1 SELECT (creds) + 1 UPDATE (sign_count) + 1 INSERT (auth_refresh_tokens) + cookies
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
error | string | sim |
Exemplos
O "Try it" está desligado nesta referência. Use os exemplos com a sua credencial de teste.
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())