eSeGeCe
software
The TsgcWSAPIServer_WebAuthn component is a Delphi/FPC server module that implements the relying‑party side of the WebAuthn protocol over HTTPS. It integrates with TsgcWebSocketHTTPServer or TsgcWebSocketServer, and it exposes REST‑like endpoints for registration and authentication.
By default, the component registers routes under /sgcWebAuthn:
| Purpose | Default Endpoint | Description |
|---|---|---|
| Registration Options | /Registration/Options | Client requests a challenge and relying‑party info before calling navigator.credentials.create |
| Registration Verify | /Registration/Verify | Browser posts the new credential, attestation object, and client data for server validation |
| Authentication Options | /Authentication/Options | Server provides a list of allowed credential IDs and a challenge |
| Authentication Verify | /Authentication/Verify | Browser posts the assertion (authenticatorData + signature) for verification |
| JavaScript Helper | /Webauthn | Delivers a helper script that wraps standard WebAuthn browser calls |
| Test Page | /Test | A quick HTML page to exercise the API for development |
Endpoints can be remapped through EndpointOptions to fit existing routing schemes.
Origins covers primary domains; TopOrigins is used when embedding in iframes.True, cross‑origin iframes may request authentication. This requires carefully curated TopOrigins and server‑side validation.ES256, RS256, EdDSA). This controls which public key types the server will accept.preferred, required, discouraged).MDS_FileName – Local cached JSON metadata (downloaded from FIDO).RootCert_FileName – Root certificate for verifying metadata signatures.Registration
OnWebAuthnRegistrationOptionsRequest(Sender, Request, Response): Inspect username, abort if invalid, or supply user information.OnWebAuthnRegistrationOptionsResponse(Sender, Request, Response): Modify the challenge or set authenticator selection criteria before sending to client.OnWebAuthnRegistrationVerify(Sender, Credential, var Success): Perform custom attestation checks or veto registration.OnWebAuthnRegistrationSuccessful(Sender, Credential): Store credential ID, public key, sign counter, and user handle in your database.OnWebAuthnRegistrationError(Sender, ErrorCode, ErrorMsg): Log or return more descriptive errors.Authentication
OnWebAuthnAuthenticationOptionsRequest(Sender, Request, Response): Lookup credential IDs for the username, decide allowed transports (USB, NFC, BLE, internal).OnWebAuthnAuthenticationOptionsResponse(Sender, Request, Response): Customize UserVerification, adjust challenge length, or embed additional metadata.OnWebAuthnAuthenticationVerify(Sender, Credential, var Success): Validate sign counter progression, enforce account status checks.OnWebAuthnAuthenticationSuccessful(Sender, Credential): Update sign counter and produce session tokens.OnWebAuthnAuthenticationError(Sender, ErrorCode, ErrorMsg): Implement rate limiting, lockout policies, and auditing.These events allow fine‑grained control over every step of the protocol, from generating options to processing assertions.
When you subscribe to the blog, we will send you an e-mail when there are new updates on the site so you wouldn't miss them.