Finish sign-in with a passkey second factor
/auth/passkey/mfa/verify
Unauthenticated, during sign-in. Checks the assertion from navigator.credentials.get() against the challenge from POST /auth/passkey/mfa/options (spent whatever the result), requires the credential to be one of this account's, verifies it with requireUserVerification: true, and then finishes the sign-in as /auth/mfa/token/verify does: it sets the session cookie and spends the mfa_token, so a second call with it is a 400.
Send with credentials: 'include' so the session cookie is stored. The response carries no user — read /user/me afterwards.
An assertion that does not verify counts as a wrong two-factor answer, on the same budget as wrong codes: 5 per 15 minutes and 20 per 24 hours per account. The answer that spends the last one ends the sign-in (the mfa_token is spent) and answers 429.
Request Body
The PublicKeyCredential returned by navigator.credentials.get(), JSON-serialized (base64url). Extra fields the browser adds are accepted and ignored.
4 properties
base64url. Max 64 KB.
base64url. Max 64 KB.
base64url. Max 64 KB.
base64url. Max 64 KB. Ignored — the credential ID resolves the user.
base64url credential ID. Max 64 KB.
base64url credential ID. Max 64 KB.
Always public-key. Max 64 characters.
public-keyThe mfa_token from the sign-in that answered mfa_required.
Response Body
trueErrors
| Status | Description |
|---|---|
400 | Missing, expired, used or wrong-purpose mfa_token; the passkey could not be verified (no live challenge for what it signed, not this account's credential, bad signature, user verification absent); unknown body keys; or a body that is not JSON. |
403 | The account is turned off. |
404 | Passkeys are not enabled for this environment, or a passkey does not count as a second factor here yet (PASSKEY_MFA is off). |
429 | Too many wrong two-factor answers for this account, or too many calls. |
curl -X POST 'https://api.truto.one/auth/passkey/mfa/verify' \
-H 'Authorization: Bearer <your_api_token>' \
-H 'Content-Type: application/json' \
-d '{
"mfa_token": "your_mfa_token",
"response": {}
}'const body = {
"mfa_token": "your_mfa_token",
"response": {}
};
const response = await fetch('https://api.truto.one/auth/passkey/mfa/verify', {
method: 'POST',
headers: {
'Authorization': 'Bearer <your_api_token>',
'Content-Type': 'application/json',
},
body: JSON.stringify(body),
});
const data = await response.json();
console.log(data);import requests
url = "https://api.truto.one/auth/passkey/mfa/verify"
headers = {
"Authorization": "Bearer <your_api_token>",
"Content-Type": "application/json",
}
params = {
}
payload = {
"mfa_token": "your_mfa_token",
"response": {}
}
response = requests.post(url, headers=headers, params=params, json=payload)
print(response.json())