The server responds to the client’s registration options request (e.g., POST /sgcWebAuthn/Registration/Options) with a JSON payload that looks like the following (after base64url-encoding binary fields):
{
"publicKey": {
"rp": {
"name": "esegece software",
"id": "esegece.com"
},
"user": {
"id": "c3ViamVjdC1pZA", // base64url-encoded ArrayBuffer (user handle)
"name": "webauthn@esegece.com",
"displayName": "Delphi Developer"
},
"challenge": "Xz8x2K6nY3gZ...", // base64url-encoded challenge
"pubKeyCredParams": [
{ "type": "public-key", "alg": -7 }, // ES256
{ "type": "public-key", "alg": -257 } // RS256
],
"timeout": 60000,
"attestation": "none",
"authenticatorSelection": {
"authenticatorAttachment": "platform",
"userVerification": "preferred",
"residentKey": "discouraged"
}
}
}
Find below a description of the fields:
Before the response is sent to the client, the event OnWebAuthnRegistrationOptionsResponse is called, allowing you to customize the response.
void OnWebAuthnRegistrationOptionsResponse(object sender,
WebAuthnRegistrationOptionsRequest request,
WebAuthnRegistrationOptionsResponse response)
{
if (request.Username == "esegece.com")
{
response.ExcludeCredentials.AddCredentialRecordFromJSON("json1.txt");
response.ExcludeCredentials.AddCredentialRecordFromJSON("json2.txt");
}
}