TsgcWSAPIServer_WebAuthn › 属性 › WebAuthnOptions
依赖方配置:RPName、RPID、Origins、支持的算法、证明格式、用户验证、超时和身份验证器选择。
property WebAuthnOptions: TsgcWSWebAuthnServer_Options read FWebAuthnOptions write SetWebAuthnOptions;
RelyingParty (RPID) 为空,必须设置为服务器 DNS 名称。算法:ES256 + RS256。所有证明格式已启用。AllowCrossOrigins:false。AllowCredentials:false。ExcludeCredentials:false。
用于凭据注册(navigator.credentials.create())和身份验证(navigator.credentials.get())的主 WebAuthn (FIDO2) 依赖方设置。RelyingParty 为必填项,必须与服务器 DNS 名称匹配(例如 www.test.com)。当请求来自其他域或嵌入的 iframe 时,可配置额外的 Origins 和 TopOrigins,AllowCrossOrigins 启用跨域 iframe 流程。Algorithms 集控制接受哪些 COSE 签名算法(ES256、ES384、ES512、RS256、RS384、RS512、PS256、PS384、PS512、RS1、EdDSA);默认仅启用 ES256 和 RS256。认证格式(None、Packed、TPM、AndroidKey、Apple、FidoU2F)可单独启用或禁用。AllowCredentials / ExcludeCredentials / Limit 控制在身份验证和注册期间发送给客户端的凭据 ID。
oWebAuthn.WebAuthnOptions.RelyingParty := 'www.test.com';
oWebAuthn.WebAuthnOptions.Origins.Add('https://login.test.com');
oWebAuthn.WebAuthnOptions.Algorithms.ES256 := True;
oWebAuthn.WebAuthnOptions.Algorithms.RS256 := True;
oWebAuthn.WebAuthnOptions.Attestation.NoneAttestation := True;
oWebAuthn.WebAuthnOptions.Attestation.PackedAttestation := True;
oWebAuthn.WebAuthnOptions.Credentials.ExcludeCredentials := True;
oWebAuthn.WebAuthnOptions.Credentials.Limit := 10;