TsgcWSAPIServer_WebAuthnEventi › OnWebAuthnRegistrationOptionsRequest

OnWebAuthnRegistrationOptionsRequest Evento

Si attiva all'inizio di /register/begin quando un client richiede PublicKeyCredentialCreationOptions; consente all'applicazione di validare l'utente e approvare o rifiutare la cerimonia.

Sintassi

property OnWebAuthnRegistrationOptionsRequest: TsgcWebAuthnOnRegistrationOptionsRequest;
// TsgcWebAuthnOnRegistrationOptionsRequest = procedure(Sender: TObject; const aRequest: TsgcWebAuthn_RegistrationOptions_Request; var Accept: Boolean) of object

Valore predefinito

Note

Primo hook della cerimonia di registrazione (WebAuthn navigator.credentials.create()). aRequest contiene il nome utente, il nome visualizzato e le preferenze fornite dal client. Accept è impostato come predefinito a true; lo imposti a false per annullare la cerimonia (ad esempio quando il nome utente è già registrato, l'utente non è autorizzato a registrare ulteriori credenziali, o la richiesta deve essere limitata). Quando accettato, il server genera il challenge e genera OnWebAuthnRegistrationOptionsResponse.

Esempio

procedure TForm1.sgcWSAPIServer_WebAuthn1WebAuthnRegistrationOptionsRequest(
  Sender: TObject; const aRequest: TsgcWebAuthn_RegistrationOptions_Request;
  var Accept: Boolean);
begin
  if UserExists(aRequest.User.Name) then
    Accept := False
  else
    Accept := True;
end;

Torna agli Eventi