WebAuthn Registratie | Antwoord

De server reageert op het registratieopties-verzoek van de client (bijv. POST /sgcWebAuthn/Registration/Options) met een JSON-payload die er als volgt uitziet (na base64url-codering van binaire velden):

 

{
"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"
}
}
}

 

 

Hieronder vindt u een beschrijving van de velden:

 

 

Voordat de respons naar de client wordt verstuurd, wordt de gebeurtenis OnWebAuthnRegistrationOptionsResponse aangeroepen, zodat u de respons kunt aanpassen.

 


procedure OnWebAuthnRegistrationOptionsResponse(Sender: TObject; const aRequest: TsgcWebAuthn_RegistrationOptions_Request; const aResponse: TsgcWebAuthn_RegistrationOptions_Response);
begin
  if aRequest.Username = 'esegece.com' then
  begin
    aResponse.ExcludeCredentials.AddCredentialRecordFromJSON('json1.txt');
    aResponse.ExcludeCredentials.AddCredentialRecordFromJSON('json2.txt');
  end;
end;