Zum Inhalt springen

Authentifizierung

Die dTax API verwendet HttpOnly-Session-Cookies zur Authentifizierung. Dies verhindert XSS-Token-Diebstahl.

Registrierung / Anmeldung

Terminal-Fenster
# 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

Die Antwort setzt ein session-HttpOnly-Cookie, das 7 Tage gültig ist.

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

OAuth

Google und GitHub OAuth werden ebenfalls unterstützt:

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

Beide leiten bei Erfolg zu getdtax.com/auth/callback weiter.