WebAuthn Server

· Funzionalità

A partire da sgcWebSockets 2025.4.0 Enterprise, the  WebAuthn Protocol is supportati (currently in BETA). 

WebAuthn (Web Autenticazione) è a web standard developed da il World Wide Web Consortium (W3C) e FIDO Alliance a abilitare secure, passwordless autenticazione su il web. It è part di il broader FIDO2 framework e aims a reduce reliance su traditional passwords, che sono often vulnerable a phishing, credential stuffing, e altro attacks.

At il suo core, WebAuthn consente utenti per autenticarsi utilizzando public-key cryptography. Instead di un username e password, utenti register a unique public-private chiave pair con a web applicazione (the Relying Party). Il private chiave è securely memorizzato su un authenticator—such come a hardware sicurezza key, smartphone, o built-in biometric device—while il public chiave è memorizzato su il server.

During authentication, il server problemi a challenge che deve essere signed da il user's private key. Il signed challenge è restituito e verified utilizzando il memorizzato public key, ensuring entrambi il integrity e origin di il response. Questo approach previene credentials da being intercepted o reused.

WebAuthn supporta a range di authenticators e devices, making it flexible per entrambi developers e users. It anche abilita multi-factor autenticazione (MFA) quando combined con altro factors like PINs o biometrics, significantly migliorando sicurezza senza sacrificing usability.

Attestation Formats Supported

Different attestation formats define come questo dati è structured e verified. Tre formati comunemente utilizzati sono android-key, packed, e altri like fido-u2f, apple, o none. Per impostazione predefinita tutti attestation formats sono enabled, puoi trovi di seguito l'elenco dei attestation formats:


WebAuthn Flow


WebAuthn Server Component

The TsgcWSAPIServer_WebAuthn component fornisce a simple ma powerful solution a implementare il WebAuthn Relying Party server, abilitando l'autenticazione senza password nella tua applicazione web. Un'applicazione WebAuthn è composta da un server WebAuthn che gestisce registrazione e autenticazione lato server e da un'applicazione client-side che di solito è un'applicazione JavaScript.


Trovi di seguito a simple configuration di il WebAuthn Server:


  // ... create il servers
  HTTPServer := TsgcWebSocketHTTPServer.Create(nil);
  WebAuthnServer := TsgcWSAPIServer_WebAuthn.Create(nil);
  WebAuthnServer.Server := HTTPServer;
  // ... enable per testing
  WebAuthnServer.EndpointsOptions.Test.Enabled := True;
  // ... WebAuthn options
  WebAuthnServer.WebAuthnOptions.RelyingParty := 'localhost';
  // ... bindings
  Server.Port := 443;
  HTTPServer.SSLOptions.Port := 443;
  HTTPServer.Bindings.Clear;
  With HTTPServer.Bindings.Add do
  begin
    Port := 443;
    IP := '127.0.0.1';
  end;
  HTTPServer.SSLOptions.Certificate := 'sgc.pem';
  HTTPServer.SSLOptions.KeyFile := 'sgc.pem';  
  HTTPServer.SSL := True;
  // ... active
  HTTPServer.Active := True; 

Delphi WebAuthn Server Demo

The following Delphi WebAuthn Demo shows come a register a nuovo credential e utilizzare dopo per autenticarsi il user.