Auth API reference

Auth API · Consumer-Auth

post/{app_slug}/v1/auth/mfa/webauthn/options

Get passkey assertion options for an open MFA challenge

Mints a single-use WebAuthn challenge scoped to the account behind `mfa_token` and returns the `publicKey` member for `navigator.credentials.get()`. Submit the result to `/auth/mfa/verify` as `credential` instead of `code`. Possession of the `mfa_token` (i.e. a correct password) is the authority — nothing here reveals whether an account exists or holds passkeys until that token has been presented.

Path parameters

app_slug*string

Slug of the app.

Request body

mfa_token*string

The `mfa_token` returned by `/auth/signin`. UUID.

Example: "3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f"

Response · 200 Assertion options. Single-use, 5-minute TTL.

public_key*object

The `publicKey` member to hand to `navigator.credentials.get()` verbatim. Single-use; 5-minute TTL.

Example

Request

POST https://api.auth.productcraft.co/{app_slug}/v1/auth/mfa/webauthn/options
Content-Type: application/json

{
  "mfa_token": "3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f"
}

Response

{
  "public_key": {}
}