GET /auth/oauth/{provider}/callback
Finaliza o 1º fator social e abre o desafio de 2º fator.
- Access: Public
- Service:
https://auth-api.axuz.net
Accepted authentication
No authentication (public route, or protected by link/signature).
Finaliza o 1º fator social e abre o desafio de 2º fator.
Wave 11: o mesmo callback atende o VÍNCULO com sessão aberta e a re-auth da REDEFINIÇÃO — o propósito vem selado no tx (oauth_link.go: finishOAuthLink / finishOAuthReset) e decide também o destino dos erros.
O quê (wave 9, piso 17 — login social NUNCA vira sessão direta): erro do provider → login com código; code+state presentes; state assinado válido; cookie tx (axuz_oauth_tx) deste navegador e deste state; troca do code (com code_verifier + conferência de nonce/aud/iss quando o provider fala PKCE — Google — e sub do id_token == sub do userinfo); profile com e-mail; usuário resolvido por oauth_identities (resolveOAuthUser — identity nova com e-mail já existente é RECUSADA com oauth_account_exists); audit; então: - política ligada: StartMFAChallenge(origin=provider), cookie HttpOnly axuz_mfa_pending=<challenge_id> e 302 para <AUTH_CLIENT_URL>/login/mfa[?next=<next validado>]; - política desligada (AUTH_MFA_REQUIRED=false, rollback): sessão direta e 302 pro next, como antes.
Entradas: chi URL param "provider"; query code, state, error; cookie axuz_oauth_tx.
Retorno: 302 (sucesso ou /login?error=<código>); 503/501 provider sem credencial/desconhecido (O-034). Efeito: SELECT/INSERT em users/oauth_identities; INSERT em auth_mfa_challenges; Set-Cookie (pending; tx expirado); audit best-effort; log de cada falha.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
provider | path | string | yes |
Responses
200
Sucesso.
302
(sucesso ou /login?error=<código>)
| Name | Type | Required | Description |
|---|---|---|---|
error | string | yes |
429
Limite de requisições excedido.
| Name | Type | Required | Description |
|---|---|---|---|
error | string | yes |
500
Erro interno. Tente de novo com backoff; reporte o X-Request-Id.
| Name | Type | Required | Description |
|---|---|---|---|
error | string | yes |
503
/501 provider sem credencial/desconhecido (O-034). Efeito: SELECT/INSERT em users/oauth_identities
| 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 GET 'https://auth-api.axuz.net/auth/oauth/PROVIDER/callback'Node.js
const res = await fetch("https://auth-api.axuz.net/auth/oauth/PROVIDER/callback", {
method: 'GET',
});
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(
"GET",
"https://auth-api.axuz.net/auth/oauth/PROVIDER/callback",
timeout=30,
)
res.raise_for_status()
print(res.json())