TsgcWSAPIServer_WebAuthnEvents › OnWebAuthnRegistrationValidateCertificate

OnWebAuthnRegistrationValidateCertificate 事件

在 /register/verify 期间触发,让应用程序验证认证证书链(例如与缓存的 FIDO MDS 进行对比)并覆盖内置检查。

语法

property OnWebAuthnRegistrationValidateCertificate: TsgcWebAuthnOnRegistrationValidateCertificate;
// TsgcWebAuthnOnRegistrationValidateCertificate = procedure(Sender: TObject; const aRequest: TsgcWebAuthn_RegistrationVerify_Request; const aValidate: TsgcWebAuthnValidateAttestationStatement; var Handled: Boolean) of object

默认值

备注

允许应用程序接管证书声明验证。aValidate 公开了已解析的证书(格式、签名、AAGUID、x5c 链),并允许处理程序将其标记为有效或无效。将 Handled 设为 true,表示您的代码已完全验证(或拒绝)该声明,内置验证器将被跳过。将 Handled 保持为 false 则在钩子之后运行默认逻辑,这在您只希望在标准检查之上添加额外策略(CA 固定、来自 MDS 的认证器允许列表)时非常有用。

示例

procedure TForm1.sgcWSAPIServer_WebAuthn1WebAuthnRegistrationValidateCertificate(
  Sender: TObject; const aRequest: TsgcWebAuthn_RegistrationVerify_Request;
  const aValidate: TsgcWebAuthnValidateAttestationStatement;
  var Handled: Boolean);
begin
  if IsAAGUIDBlocked(aValidate.AAGUID) then
  begin
    aValidate.Valid := False;
    Handled := True;
  end;
end;

返回事件