/v1/auth/mfa/verifyFinish sign-in with the second step
Send exactly one of `{factor_id, code}` (authenticator app or email), `{recovery_code}` or `{factor_id, webauthn}`. A right answer returns the session tokens, exactly like a sign-in without two-step. A wrong one spends one of the challenge's 5 tries. Not idempotent: the answer is a session.
Request body
mfa_token*string`mfa_token` from the sign-in answer.
factor_idstring · uuidThe factor answered (TOTP, email or passkey). Omit with `recovery_code`.
codestring6-digit TOTP or email code.
recovery_codestringA recovery code (`abcd-efgh-jk`, case-insensitive, dashes optional). Works once.
webauthnobjectThe `PublicKeyCredential` from `navigator.credentials.get()`, ArrayBuffers base64url-encoded: `{ id, raw_id, type: "public-key", response: { clientDataJSON, authenticatorData, signature, userHandle } }`. WebAuthn member names are passed through verbatim (camelCase by spec).
Response · 200
access_token*stringAccess token (JWT)
Example: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
refresh_tokenstringRefresh token (JWT)
Example: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
token_type*stringToken type
Example: "Bearer"
expires_in*numberAccess token TTL in seconds
Example: 3600
Example
Request
POST https://api.platform-auth.productcraft.co/v1/auth/mfa/verify
Content-Type: application/json
{
"mfa_token": "string",
"factor_id": "00000000-0000-0000-0000-000000000000",
"code": "string",
"recovery_code": "string",
"webauthn": {}
}Response
{
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"token_type": "Bearer",
"expires_in": 3600
}