Start a passkey second factor
/auth/passkey/mfa/options
Unauthenticated, during sign-in. A sign-in (password, magic link, social) of an account that has an authenticator app or a passkey answers mfa_required with an mfa_token and mfa_methods, the second factors the account can use, passkey first: passkey, totp, or both. POST /auth/login returns them in its JSON body ({ "mfa_required": true, "mfa_token": "…", "mfa_methods": ["passkey", "totp"] }); a browser sign-in redirects to the app's /auth/mfa/verify?mfa_token=…&mfa_methods=passkey,totp. A passkey also meets a team's two-factor requirement. A backup code (/auth/mfa/token/verify-backup) works whichever methods are listed.
A passkey counts as a second factor only where the PASSKEY_MFA server setting is on. Where it is off, sign-in treats a passkey as before (an account with only a passkey is not asked for a second factor, and mfa_methods never lists passkey), and these four /auth/passkey/mfa* routes answer 404. The same setting decides methods and enabled in GET /auth/mfa/manage/status, mfa_methods and mfa_enabled in GET /user/me, and whether a passkey keeps a team's two-factor rule met.
When mfa_methods includes passkey, this issues the PublicKeyCredentialRequestOptionsJSON for navigator.credentials.get(): allowCredentials names the account's passkeys and userVerification is required. The challenge is stored server-side against the account for 5 minutes and is single-use; a new call replaces it. Answer it with POST /auth/passkey/mfa/verify.
The mfa_token must be the one from sign-in (purpose mfa_verify); any other is a 400. At most ten calls per minute per account (429 with Retry-After), behind the same per-IP and per-account budgets as /auth/mfa/token/*.
Request Body
The mfa_token from the sign-in that answered mfa_required.
Response Body
A bare PublicKeyCredentialRequestOptionsJSON — pass it straight to navigator.credentials.get({ publicKey }). Note rpId is flat here, unlike the nested rp object on registration options.
Always empty — sign-in is usernameless, so the browser offers whichever discoverable credential it holds for this rpId. Naming credentials here would leak which accounts exist.
base64url challenge. Single-use, stored server-side for 5 minutes under handle.
qsNjZMVirtbhRzdVbqWzyBiP224DB-Bu0X3_JqJJTNQThe environment's APP_URL host.
app.truto.one60000requiredrequired
Errors
| Status | Description |
|---|---|
400 | Missing, expired or wrong-purpose mfa_token, the account has no passkey, 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 calls for this account or from this IP. |
curl -X POST 'https://api.truto.one/auth/passkey/mfa/options' \
-H 'Authorization: Bearer <your_api_token>' \
-H 'Content-Type: application/json' \
-d '{
"mfa_token": "your_mfa_token"
}'const body = {
"mfa_token": "your_mfa_token"
};
const response = await fetch('https://api.truto.one/auth/passkey/mfa/options', {
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/options"
headers = {
"Authorization": "Bearer <your_api_token>",
"Content-Type": "application/json",
}
params = {
}
payload = {
"mfa_token": "your_mfa_token"
}
response = requests.post(url, headers=headers, params=params, json=payload)
print(response.json())