TsgcWSAPIServer_WebAuthn方法 › DoProcessHTTP

DoProcessHTTP 方法

HTTP 管道的入口点;调度 WebAuthn 注册、身份验证和授权请求。

语法

function DoProcessHTTP(const aConnection: TsgcWSConnection; const aHeaders: TStringList): Boolean;

参数

名称类型描述
aConnectionconst TsgcWSConnection接收请求的活动 HTTP/WebSocket 连接。
aHeadersconst TStringList从主机服务器转发的原始 HTTP 请求标头(包括请求行)。

返回值

当请求匹配到 WebAuthn 端点且已完全处理时返回 True;当请求不针对 WebAuthn 且需由调用方处理时返回 False。(Boolean

备注

通常从主机服务器的 OnCommandGet/OnCommandPost(或等效的 HTTP API 事件)连接。该方法通过 IsWebAuthnRequest 检查请求是否针对 WebAuthn 端点,如果是,则构建内部请求/响应对象并分发注册或身份验证流程。

示例

procedure TForm1.sgcWebSocketServer1CommandGet(aConnection: TsgcWSConnection;
  aRequestInfo: TIdHTTPRequestInfo; aResponseInfo: TIdHTTPResponseInfo);
begin
  if sgcWSAPIServer_WebAuthn1.DoProcessHTTP(aConnection, aRequestInfo.RawHeaders) then
    Exit;
  // ... fall through to your own HTTP handling
end;

返回方法