WebAuthn / Passkeys
Add passkey-based passwordless authentication to your Delphi server. WebAuthn Level 2 / FIDO2 registration and authentication ceremonies, attestation verification, credential storage hooks.
Add passkey-based passwordless authentication to your Delphi server. WebAuthn Level 2 / FIDO2 registration and authentication ceremonies, attestation verification, credential storage hooks.
Implements the WebAuthn relying-party server side — create credential challenges, verify navigator.credentials responses, parse attestation statements and validate assertion signatures.
TsgcWSAPIServer_WebAuthn
Windows, macOS, Linux, iOS, Android
Enterprise
Drop a TsgcWSAPIServer_WebAuthn on a TsgcWebSocketHTTPServer, configure RpId/RpName, then handle OnRegistrationVerify and OnAuthenticationVerify to persist credentials.
uses
sgcWebSocket, sgcWebSocket_Server_APIs;
var
Server: TsgcWebSocketHTTPServer;
WebAuthn: TsgcWSAPIServer_WebAuthn;
begin
Server := TsgcWebSocketHTTPServer.Create(nil);
Server.Port := 8443;
Server.SSL := True;
WebAuthn := TsgcWSAPIServer_WebAuthn.Create(nil);
WebAuthn.Server := Server;
WebAuthn.RelyingParty.Id := 'example.com';
WebAuthn.RelyingParty.Name := 'Example RP';
WebAuthn.OnRegistrationVerify := procedure(Sender: TObject;
const aRequest: TsgcWebAuthn_RegistrationVerify_Request;
const aRegistration: TsgcWebAuthn_Registration; const aError: string)
begin
// store aRegistration.CredentialId / publicKey / counter / userHandle
end;
Server.Active := True;
end;
// uses: sgcWebSocket, sgcWebSocket_Server_APIs
TsgcWebSocketHTTPServer *Server = new TsgcWebSocketHTTPServer(this);
TsgcWSAPIServer_WebAuthn *WebAuthn = new TsgcWSAPIServer_WebAuthn(this);
WebAuthn->Server = Server;
WebAuthn->RelyingParty->Id = "example.com";
WebAuthn->RelyingParty->Name = "Example RP";
Server->Active = true;
A relying-party server that turns a Delphi process into a passkey-aware authentication endpoint.
OnRegistrationOptions issues PublicKeyCredentialCreationOptions; the browser invokes navigator.credentials.create(); OnRegistrationVerify validates the attestation and returns the new credential record.
OnAuthenticationOptions issues PublicKeyCredentialRequestOptions with the previously stored credential IDs; OnAuthenticationVerify validates the assertion signature using the stored public key.
Supports none, packed, fido-u2f, tpm, android-key, android-safetynet and apple attestation statement formats.
Tracks the per-credential signCount to detect cloned authenticators — if the counter regresses, OnAuthenticationVerify reports an error you can act on.
UserVerification can be set to required, preferred or discouraged per ceremony — the validation step enforces the choice.
OnAuthenticationOptions hands you the user handle so you return the right list of allowCredentials for the in-progress login — storage is yours to design.
Authoritative sources for the standards this component implements.
Deep-link to the component reference, grab the ready-to-run demo project, and download the trial.
| Online Help — TsgcWSAPIServer_WebAuthn Full property, method and event reference for this component. | Open | |
| Demo Project — Demos\20.HTTP_Protocol\12.WebAuthn Ready-to-run example project. Ships inside the sgcWebSockets package — download the trial below. | Open | |
| Technical Document (PDF) Features, quick start, code samples for Delphi & C++ Builder and primary-source references — this component only. | Open | |
| User Manual (PDF) Comprehensive manual covering every component in the library. | Open |