Saltearse al contenido

Autenticación

La API de dTax usa cookies de sesión HttpOnly para la autenticación. Esto previene el robo de tokens mediante XSS.

Registro / Inicio de sesión

Ventana de terminal
# Create account
curl -X POST https://getdtax.com/api/v1/auth/register \
-H "Content-Type: application/json" \
-d '{"email":"[email protected]","password":"yourpassword"}' \
-c cookies.txt
# Login
curl -X POST https://getdtax.com/api/v1/auth/login \
-H "Content-Type: application/json" \
-d '{"email":"[email protected]","password":"yourpassword"}' \
-c cookies.txt

La respuesta establece una cookie session HttpOnly válida por 7 días.

Ventana de terminal
# All subsequent requests use -b cookies.txt
curl https://getdtax.com/api/v1/transactions \
-b cookies.txt

OAuth

Google y GitHub OAuth también son compatibles:

GET https://getdtax.com/auth/google
GET https://getdtax.com/auth/github

Ambos redirigen a getdtax.com/auth/callback al completarse correctamente.