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.
POST
/auth/login
curl
curl -X POST "http://api.example.com/auth/login" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"email": "admin@example.com",
"password": "mysecretpassword",
"totp": 123456,
"email_otp": 123456,
"fido_authentication_response": {},
"recovery_code": "ABCD-EFGH-IJKL-MNOP"
}'
import requests
url = "http://api.example.com/auth/login"
headers = {
"Authorization": "Bearer YOUR_API_TOKEN",
"Accept": "application/json",
"Content-Type": "application/json"
}
params = {}
payload = {
"email": "admin@example.com",
"password": "mysecretpassword",
"totp": 123456,
"email_otp": 123456,
"fido_authentication_response": {},
"recovery_code": "ABCD-EFGH-IJKL-MNOP"
}
response = requests.post(
url,
headers=headers,
params=params,
json=payload
)
response.raise_for_status()
if response.content:
print(response.json())
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"
}