passkeyLogin
POST
/api/v1/auth/passkey/login
const url = 'https://example.com/api/v1/auth/passkey/login';const options = { method: 'POST', headers: {'X-MFA-Challenge': 'example', 'Content-Type': 'application/json'}, body: '{"id":"example","rawId":"example","type":"public-key","authenticatorAttachment":"platform","clientExtensionResults":{},"response":{"clientDataJSON":"example","authenticatorData":"example","signature":"example","userHandle":"example"}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/api/v1/auth/passkey/login \ --header 'Content-Type: application/json' \ --header 'X-MFA-Challenge: example' \ --data '{ "id": "example", "rawId": "example", "type": "public-key", "authenticatorAttachment": "platform", "clientExtensionResults": {}, "response": { "clientDataJSON": "example", "authenticatorData": "example", "signature": "example", "userHandle": "example" } }'Posts the raw WebAuthn assertion. A verified passkey satisfies multi-factor authentication on its own.
Parameters
Section titled “ Parameters ”Header Parameters
Section titled “Header Parameters”X-MFA-Challenge
required
string
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
A PublicKeyCredential from navigator.credentials.get(), serialized with base64url binary fields.
object
id
required
string
rawId
required
Base64url
string
type
required
string
authenticatorAttachment
string
clientExtensionResults
object
key
additional properties
any
response
required
object
clientDataJSON
required
Base64url
string
authenticatorData
required
Base64url
string
signature
required
Base64url
string
userHandle
Base64url
string
Responses
Section titled “ Responses ”Signed in
Media typeapplication/json
object
data
required
object
user
required
object
id
required
string format: uuid
name
required
string
username
required
string
role
required
Role key. The built-in roles are owner, administrator, editor, contributor, and viewer. Custom role keys start with “custom.”. Decide authorization from the capabilities the server reports, not from the role key.
string
active
required
boolean
createdAt
required
string format: date-time
lastLoginAt
string format: date-time
capabilities
Effective capabilities of the signed-in user’s role.
Array<string>
csrfToken
required
string
authMethod
required
string
mfaEnrollmentRequired
required
boolean
Example
{ "data": { "user": { "role": "owner" }, "authMethod": "password" }}The passkey could not be verified