Recover WebAuthn account
Recover a WebAuthn account
POST
/{apiBasePath}/{tenantId}/webauthn/recover/accountPath parameters
apiBasePathstringrequiredIts value depends on the apiBasePath set by the user
tenantIdstringThe tenant against which the request is made. If left empty, the default tenant will be used.
Header parameters
ridstringThe WebAuthn recipe ID
Request body
application/jsontokenstringrequiredwebauthnGeneratedOptionsIdstringrequiredcredentialregistrationPayloadrequiredWebAuthn registration payload
Show propertiesHide properties
idstringrequiredCredential ID
rawIdstringrequiredRaw credential ID
authenticatorAttachmentstringType of authenticator
Allowed:
platformcross-platformclientExtensionResultsobjectClient extension results
responseobjectrequiredRegistration response
Show propertiesHide properties
clientDataJSONstringrequiredClient data JSON
attestationObjectstringrequiredAttestation object
authenticatorDatastringAuthenticator data
transportsstring[]Supported transports
publicKeystringPublic key
publicKeyAlgorithmnumberPublic key algorithm
typestringrequiredCredential type
Allowed:
public-keyResponses
200Account recovery response
One of:
object
statusstatusOKSuccess status indicator
Allowed:
OKuseruserUser information
Show propertiesHide properties
iduserIdUnique identifier for a user
timeJoinednumberTimestamp when user joined
isPrimaryUserbooleanWhether this is the primary user account
tenantIdsstring[]List of tenant IDs the user belongs to
emailsstring[]List of user's email addresses
phoneNumbersstring[]List of user's phone numbers
thirdPartyobject[]List of third party accounts
Show propertiesHide properties
Array of
objectidstringThird party provider ID
userIdstringUser ID in the third party system
loginMethodsobject[]List of login methods available to the user
Show propertiesHide properties
Array of
objectrecipeIdstringThe recipe ID for this login method
Allowed:
emailpasswordthirdpartypasswordlessrecipeUserIduserIdUnique identifier for a user
verifiedbooleanWhether this login method is verified
tenantIdsstring[]List of tenant IDs for this login method
timeJoinednumberTimestamp when this login method was added
emailstringEmail address for this login method
phoneNumberstringPhone number for this login method
thirdPartyobjectThird party information for this login method
Show propertiesHide properties
idstringThird party provider ID
userIdstringUser ID in the third party system
emailemailEmail address
generalErrorResponse
statusstringError status code
Allowed:
GENERAL_ERRORmessagestringError message
object
statusstringAllowed:
INVALID_CREDENTIALS_ERRORRECOVER_ACCOUNT_TOKEN_INVALID_ERROROPTIONS_NOT_FOUND_ERRORINVALID_OPTIONS_ERRORobject
statusstringAllowed:
INVALID_AUTHENTICATOR_ERRORreasonstring404Resource not found error
string500Internal server error
stringTry it
Server
Parameters
Bodyapplication/json
Request
curl -X POST "/auth/public/webauthn/recover/account" \
-H "Content-Type: application/json" \
-d '{
"token": "abc123...",
"webauthnGeneratedOptionsId": "opt_123...",
"credential": {
"id": "cred_123...",
"rawId": "base64rawid...",
"authenticatorAttachment": "platform",
"clientExtensionResults": {},
"response": {
"clientDataJSON": "base64clientdata...",
"attestationObject": "base64attestation...",
"authenticatorData": "base64authenticatordata...",
"transports": [
"usb"
],
"publicKey": "base64publickey...",
"publicKeyAlgorithm": -7
},
"type": "public-key"
}
}'const response = await fetch("/auth/public/webauthn/recover/account", {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({
"token": "abc123...",
"webauthnGeneratedOptionsId": "opt_123...",
"credential": {
"id": "cred_123...",
"rawId": "base64rawid...",
"authenticatorAttachment": "platform",
"clientExtensionResults": {},
"response": {
"clientDataJSON": "base64clientdata...",
"attestationObject": "base64attestation...",
"authenticatorData": "base64authenticatordata...",
"transports": [
"usb"
],
"publicKey": "base64publickey...",
"publicKeyAlgorithm": -7
},
"type": "public-key"
}
})
});import requests
response = requests.post(
"/auth/public/webauthn/recover/account",
headers={
"Content-Type": "application/json"
},
json={
"token": "abc123...",
"webauthnGeneratedOptionsId": "opt_123...",
"credential": {
"id": "cred_123...",
"rawId": "base64rawid...",
"authenticatorAttachment": "platform",
"clientExtensionResults": {},
"response": {
"clientDataJSON": "base64clientdata...",
"attestationObject": "base64attestation...",
"authenticatorData": "base64authenticatordata...",
"transports": [
"usb"
],
"publicKey": "base64publickey...",
"publicKeyAlgorithm": -7
},
"type": "public-key"
}
},
)Response
{
"status": "OK",
"user": {
"id": "fa7a0841-b533-4478-95533-0fde890c3483",
"timeJoined": 1638433545183,
"isPrimaryUser": true,
"tenantIds": [
"public"
],
"emails": [
"johndoe@gmail.com"
],
"phoneNumbers": [
36201234123
],
"thirdParty": [
{
"id": "google",
"userId": "rq238mrq2389rvq123213"
}
],
"loginMethods": [
{
"recipeId": "emailpassword",
"recipeUserId": "fa7a0841-b533-4478-95533-0fde890c3483",
"verified": true,
"tenantIds": [
"public"
],
"timeJoined": 1638433545183,
"email": "johndoe@gmail.com",
"phoneNumber": 36201234123,
"thirdParty": {
"id": "google",
"userId": "rq238mrq2389rvq123213"
}
}
]
},
"email": "johndoe@gmail.com"
}"Not Found""Internal Error"