Generate registration options
Generate the webauthn options for registration.
POST
/appid-{appId}/{tenantId}/recipe/webauthn/options/registerAuthorization
api-keyAPI key · headerrequiredThe core service API token. If you are using a self-hosted core service and you have not generated a token, you can omit the header.
Path parameters
tenantIdstringThe tenant against which the request is made. If left empty, the default tenant will be used.
Header parameters
cdi-versionstringX.Y of the X.Y.Z CDI version.
Request body
application/jsonemailemailrequireddisplayNamestringrelyingPartyIdstringrequiredrelyingPartyNamestringrequiredoriginstringrequiredtimeoutnumberuserVerificationstringuserPresencebooleanattestationstringresidentKeystringsupportedAlgorithmIDsnumber[]Responses
200The generated register options response
One of:
object
statusstatusOKAllowed:
OKwebauthnGeneratedOptionsIdstringrpobjectShow propertiesHide properties
idstringnamestringuserobjectShow propertiesHide properties
idstringnamestringdisplayNamestringemailemailchallengestringtimeoutnumberattestationstringcreatedAtnumberexpiresAtnumberpubKeyCredParamsobject[]Show propertiesHide properties
Array of
objecttypestringalgnumberexcludeCredentialsobject[]Show propertiesHide properties
Array of
objectidstringtransportstring[]authenticatorSelectionobjectShow propertiesHide properties
userVerificationstringrequireResidentKeybooleanobject
statusstringAllowed:
INVALID_OPTIONS_ERRORreasonstring400error code 400
string401error code 401
string404error code 404
string500error code 500
stringTry it
Server
Authorization
Parameters
Bodyapplication/json
Request
curl -X POST "/appid-{appId}/public/recipe/webauthn/options/register" \
-H "api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"email": "johndoe@gmail.com",
"displayName": "John Doe",
"relyingPartyId": "example.com",
"relyingPartyName": "Example",
"origin": "http://example.com",
"timeout": 10000,
"userVerification": "preferred",
"userPresence": false,
"attestation": "none",
"residentKey": "required",
"supportedAlgorithmIDs": [
-7
]
}'const response = await fetch("/appid-{appId}/public/recipe/webauthn/options/register", {
method: "POST",
headers: {
"api-key": "YOUR_API_KEY",
"Content-Type": "application/json"
},
body: JSON.stringify({
"email": "johndoe@gmail.com",
"displayName": "John Doe",
"relyingPartyId": "example.com",
"relyingPartyName": "Example",
"origin": "http://example.com",
"timeout": 10000,
"userVerification": "preferred",
"userPresence": false,
"attestation": "none",
"residentKey": "required",
"supportedAlgorithmIDs": [
-7
]
})
});import requests
response = requests.post(
"/appid-{appId}/public/recipe/webauthn/options/register",
headers={
"api-key": "YOUR_API_KEY",
"Content-Type": "application/json"
},
json={
"email": "johndoe@gmail.com",
"displayName": "John Doe",
"relyingPartyId": "example.com",
"relyingPartyName": "Example",
"origin": "http://example.com",
"timeout": 10000,
"userVerification": "preferred",
"userPresence": False,
"attestation": "none",
"residentKey": "required",
"supportedAlgorithmIDs": [
-7
]
},
)Response
{
"status": "OK",
"webauthnGeneratedOptionsId": "fa7a0841-b533-4478-9253-0fde890c576",
"rp": {
"id": "example.com",
"name": "Example"
},
"user": {
"id": "fa7a0841-b533-4478-9253-0fde890c576",
"name": "John Doe",
"displayName": "John Doe"
},
"email": "johndoe@gmail.com",
"challenge": "TQvEVDV8B64w_2zIifzKaPzBPfthqpx2uJkq_2PIB0k",
"timeout": 10000,
"attestation": "none",
"createdAt": 1741793746,
"expiresAt": 1741793746,
"pubKeyCredParams": [
{
"type": "public-key",
"alg": -7
}
],
"excludeCredentials": [
{
"id": "fa7a0841-b533-4478-9253-0fde890c576",
"transport": [
"internal"
]
}
],
"authenticatorSelection": {
"userVerification": "preferred",
"requireResidentKey": true
}
}"string""Invalid API key""Not Found""Internal Error"