Exchange a challenge token and a second factor for a session
curl --request POST \
--url https://app.trustivan.com/api/v1/auth/mfa/verify \
--header 'Content-Type: application/json' \
--data '
{
"challenge_token": "<string>",
"code": "<string>"
}
'import requests
url = "https://app.trustivan.com/api/v1/auth/mfa/verify"
payload = {
"challenge_token": "<string>",
"code": "<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({challenge_token: '<string>', code: '<string>'})
};
fetch('https://app.trustivan.com/api/v1/auth/mfa/verify', 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/mfa/verify"
payload := strings.NewReader("{\n \"challenge_token\": \"<string>\",\n \"code\": \"<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))
}{
"error": "<string>",
"code": "validation_failed",
"required_scope": "<string>",
"principal": "user"
}Exchange a challenge and second factor for a session
The only path by which a user with MFA enabled obtains a session. A password alone returns a challenge, never cookies.
code accepts a six-digit TOTP code or a recovery code. Both are
single-use: a TOTP step already spent on this account is refused even
while it is still within its time window.
Every failure (wrong code, replayed code, unknown challenge, expired challenge, attempts exhausted) answers the same 401. Telling them apart would tell an attacker whether a captured token is still live.
POST
/
auth
/
mfa
/
verify
Exchange a challenge token and a second factor for a session
curl --request POST \
--url https://app.trustivan.com/api/v1/auth/mfa/verify \
--header 'Content-Type: application/json' \
--data '
{
"challenge_token": "<string>",
"code": "<string>"
}
'import requests
url = "https://app.trustivan.com/api/v1/auth/mfa/verify"
payload = {
"challenge_token": "<string>",
"code": "<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({challenge_token: '<string>', code: '<string>'})
};
fetch('https://app.trustivan.com/api/v1/auth/mfa/verify', 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/mfa/verify"
payload := strings.NewReader("{\n \"challenge_token\": \"<string>\",\n \"code\": \"<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))
}{
"error": "<string>",
"code": "validation_failed",
"required_scope": "<string>",
"principal": "user"
}