Generate Sign-In Options
curl -X POST https://your-domain.com/recipe/webauthn/options/signin \
-H "Content-Type: application/json" \
-d '{
"relyingPartyId": "example.com",
"relyingPartyName": "My App",
"origin": "https://example.com",
"timeout": 60000,
"userVerification": "preferred",
"userPresence": false
}'
{
"status": "OK",
"webauthnGeneratedOptionsId": "generated-options-id",
"publicKey": {
"challenge": "base64-encoded-challenge",
"timeout": 60000,
"rpId": "example.com",
"userVerification": "preferred",
"allowCredentials": []
}
}
Relying party identifier (must match registration)
Human-readable name of the relying party
Origin URL for credential binding
Timeout in milliseconds (default: 60000)
User verification requirement: “required”, “preferred”, “discouraged” (default: “preferred”)
Whether user presence is required (default: false)
“OK” or “INVALID_OPTIONS_ERROR”
webauthnGeneratedOptionsId
Unique identifier for these options (used in subsequent sign-in call)
WebAuthn PublicKeyCredentialRequestOptions to pass to navigator.credentials.get()
Sign In with Credential
curl -X POST https://your-domain.com/recipe/webauthn/signin \
-H "Content-Type: application/json" \
-d '{
"webauthnGeneratedOptionsId": "generated-options-id",
"credential": {
"id": "credential-id",
"rawId": "base64-raw-id",
"response": {
"authenticatorData": "base64-authenticator-data",
"clientDataJSON": "base64-client-data",
"signature": "base64-signature",
"userHandle": "base64-user-handle"
},
"type": "public-key"
}
}'
{
"status": "OK",
"user": {
"id": "user-id",
"isPrimaryUser": false,
"tenantIds": ["public"],
"emails": ["[email protected]"],
"phoneNumbers": [],
"thirdParty": [],
"loginMethods": [
{
"recipeId": "webauthn",
"recipeUserId": "recipe-user-id",
"tenantIds": ["public"],
"email": "[email protected]",
"timeJoined": 1234567890,
"verified": true,
"webauthN": {
"credentialIds": ["credential-id"]
}
}
],
"timeJoined": 1234567890
},
"recipeUserId": "recipe-user-id"
}
webauthnGeneratedOptionsId
ID from the options generation response
PublicKeyCredential object from navigator.credentials.get()
“OK”, “INVALID_OPTIONS_ERROR”, “INVALID_AUTHENTICATOR_ERROR”, “INVALID_CREDENTIALS_ERROR”, “OPTIONS_NOT_FOUND_ERROR”, “CREDENTIAL_NOT_FOUND_ERROR”, or “UNKNOWN_USER_ID_ERROR”
Authenticated user object with login methods
The recipe user ID for the authenticated login method