TsgcWSAPIServer_WebAuthnMethods › DoProcessHTTP

DoProcessHTTP Method

Entry point of the HTTP pipeline; dispatches WebAuthn registration, authentication and authorization requests.

Syntax

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

Parameters

NameTypeDescription
aConnectionconst TsgcWSConnectionActive HTTP/WebSocket connection that received the request.
aHeadersconst TStringListRaw HTTP request headers (including the request line) forwarded from the host server.

Return Value

True when the request matched a WebAuthn endpoint and was fully processed; False when the request is not for WebAuthn and must be handled by the caller. (Boolean)

Remarks

Normally wired from the host server OnCommandGet/OnCommandPost (or equivalent HTTP API event). The method checks if the request targets a WebAuthn endpoint via IsWebAuthnRequest and, if so, builds the internal request/response objects and dispatches the registration or authentication flow.

Example

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;

Back to Methods