curl --request POST \
--url https://app.trustivan.com/api/v1/auth/login \
--header 'Content-Type: application/json' \
--data '
{
"email": "jsmith@example.com",
"password": "<string>"
}
'import requests
url = "https://app.trustivan.com/api/v1/auth/login"
payload = {
"email": "jsmith@example.com",
"password": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({email: 'jsmith@example.com', password: '<string>'})
};
fetch('https://app.trustivan.com/api/v1/auth/login', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.trustivan.com/api/v1/auth/login"
payload := strings.NewReader("{\n \"email\": \"jsmith@example.com\",\n \"password\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"mfa_required": true,
"mfa_enrollment_required": true,
"challenge_token": "<string>",
"methods": [
"totp"
]
}{
"error": "<string>",
"code": "validation_failed",
"required_scope": "<string>",
"principal": "user"
}Start a browser session
A correct password does not always produce a session. If the account
has a confirmed second factor the response is still 200, but it
carries mfa_required and a challenge token instead of cookies, and
the caller must exchange that token at /auth/mfa/verify.
Branch on mfa_required, never on the status code. A client that reads
200 as “signed in” lands on an authenticated page with no session.
The challenge response deliberately does not identify the user: returning the email or name would let anyone who guessed a password learn whose account it was without completing the login.
If the account has no second factor but an organization it belongs to
requires one (PUT /identity/mfa-policy), the 200 carries
mfa_enrollment_required and a challenge token instead: the user
enrols at /auth/mfa/required-enrollment and gets the session from
/auth/mfa/required-enrollment/confirm.
Per-account lockout: from the fifth consecutive wrong password the
account is locked for 30 seconds, doubling with each further failure
up to 15 minutes, and unlocked early by nothing but time. A locked
account answers exactly as a wrong password does (same status, same
body, same work), so the lockout does not reveal whether an address is
registered. A correct password resets the count. Each lock is recorded
on the identity trail as login.locked.
curl --request POST \
--url https://app.trustivan.com/api/v1/auth/login \
--header 'Content-Type: application/json' \
--data '
{
"email": "jsmith@example.com",
"password": "<string>"
}
'import requests
url = "https://app.trustivan.com/api/v1/auth/login"
payload = {
"email": "jsmith@example.com",
"password": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({email: 'jsmith@example.com', password: '<string>'})
};
fetch('https://app.trustivan.com/api/v1/auth/login', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.trustivan.com/api/v1/auth/login"
payload := strings.NewReader("{\n \"email\": \"jsmith@example.com\",\n \"password\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"mfa_required": true,
"mfa_enrollment_required": true,
"challenge_token": "<string>",
"methods": [
"totp"
]
}{
"error": "<string>",
"code": "validation_failed",
"required_scope": "<string>",
"principal": "user"
}Response
Either the session was established (cookies are set and the body carries no credential) or a second factor is required.