Login user

POST /auth/login

Log in user by creating and registering auth tokens. Login is based on email and password. If no user matches given email It fallbacks to a desktop ID. It is useful for desktop tools that don't know user email. It is also possible to login with TOTP, Email OTP, FIDO and recovery code.

application/json

Body Required

  • email string(email) Required

    User email address

  • password string(password) Required

    User password

  • totp string

    TOTP verification code for two-factor authentication

  • email_otp string

    Email OTP verification code for two-factor authentication

  • fido_authentication_response object

    FIDO authentication response for WebAuth

  • recovery_code string

    Recovery code for two-factor authentication

Responses

  • 200

    Login successful

  • 400

    Login failed

POST /auth/login
curl \
 --request POST 'http://api.example.com/auth/login' \
 --header "Authorization: $API_KEY" \
 --header "Content-Type: application/json" \
 --data '{"email":"admin@example.com","password":"mysecretpassword","totp":123456,"email_otp":123456,"fido_authentication_response":{},"recovery_code":"ABCD-EFGH-IJKL-MNOP"}'
Request examples
{
  "email": "admin@example.com",
  "password": "mysecretpassword",
  "totp": 123456,
  "email_otp": 123456,
  "fido_authentication_response": {},
  "recovery_code": "ABCD-EFGH-IJKL-MNOP"
}