WebAuthnLogin
TsgcHTMLComponent_WebAuthnLogin — um widget de login e registro passkey/WebAuthn sem senha que emite JavaScript baseado em SimpleWebAuthn, em Delphi, C++ Builder e .NET.
TsgcHTMLComponent_WebAuthnLogin — um widget de login e registro passkey/WebAuthn sem senha que emite JavaScript baseado em SimpleWebAuthn, em Delphi, C++ Builder e .NET.
Um widget de passkey que renderiza botões de registro e login mais o script do lado do navegador. Ele se comunica com seus endpoints /options e /verify através do SimpleWebAuthnBrowser. Defina o modo e as URLs e então leia HTML — ou use o helper estático Build.
TsgcHTMLComponent_WebAuthnLogin
Markup Bootstrap 5 + JS WebAuthn
Delphi, C++ Builder, .NET
O helper estático Build renderiza o widget em uma única chamada. Use o componente completo quando precisar de um título personalizado, seletor de usuário ou seu próprio script.
uses
sgcHTML_Enums, sgcHTML_Component_WebAuthnLogin;
// One-liner (register + authenticate, default endpoints):
WebModule.Response := TsgcHTMLComponent_WebAuthnLogin.Build(
wamBoth, '/webauthn/register', '/webauthn/authenticate');
// Full control:
var
oWA: TsgcHTMLComponent_WebAuthnLogin;
begin
oWA := TsgcHTMLComponent_WebAuthnLogin.Create(nil);
try
oWA.Mode := wamBoth;
oWA.RegisterURL := '/webauthn/register';
oWA.AuthenticateURL := '/webauthn/authenticate';
oWA.CallbackURL := '/dashboard';
oWA.Title := 'Passwordless sign-in';
oWA.ShowPasskeyIcon := True;
oWA.UsernameSelector := '#username';
WebModule.Response := oWA.HTML; // buttons + SimpleWebAuthn JS
finally
oWA.Free;
end;
end;
// includes: sgcHTML_Enums.hpp, sgcHTML_Component_WebAuthnLogin.hpp
// One-liner (register + authenticate, default endpoints):
String html = TsgcHTMLComponent_WebAuthnLogin::Build(
wamBoth, "/webauthn/register", "/webauthn/authenticate");
// Full control:
TsgcHTMLComponent_WebAuthnLogin *oWA = new TsgcHTMLComponent_WebAuthnLogin(NULL);
try
{
oWA->Mode = wamBoth;
oWA->RegisterURL = "/webauthn/register";
oWA->AuthenticateURL = "/webauthn/authenticate";
oWA->CallbackURL = "/dashboard";
oWA->Title = "Passwordless sign-in";
oWA->ShowPasskeyIcon = true;
oWA->UsernameSelector = "#username";
String full = oWA->HTML; // buttons + SimpleWebAuthn JS
}
__finally
{
delete oWA;
}
using esegece.sgcWebSockets;
// One-liner (register + authenticate, default endpoints):
string html = TsgcHTMLComponent_WebAuthnLogin.Build(
TsgcHTMLWebAuthnMode.wamBoth, "/webauthn/register", "/webauthn/authenticate");
// Full control:
var wa = new TsgcHTMLComponent_WebAuthnLogin();
wa.Mode = TsgcHTMLWebAuthnMode.wamBoth;
wa.RegisterURL = "/webauthn/register";
wa.AuthenticateURL = "/webauthn/authenticate";
wa.CallbackURL = "/dashboard";
wa.Title = "Passwordless sign-in";
wa.ShowPasskeyIcon = true;
wa.UsernameSelector = "#username";
string full = wa.HTML; // buttons + SimpleWebAuthn JS
Os membros que você usa com mais frequência.
Build(aMode, aRegisterURL, aAuthenticateURL) renderiza o widget inteiro em uma chamada, com padrões sensatos para o modo e os endpoints.
Mode seleciona wamRegister, wamAuthenticate ou wamBoth, decidindo quais botões aparecem.
RegisterURL e AuthenticateURL são as bases do seu servidor (o script anexa /options e /verify); CallbackURL é onde um login bem-sucedido leva.
RegisterButtonText, AuthenticateButtonText, RegisterButtonStyle, AuthenticateButtonStyle, Title, Description e ShowPasskeyIcon moldam a UI.
UsernameSelector lê o nome de usuário de um campo antes de registrar; CustomScript substitui inteiramente o JavaScript SimpleWebAuthn embutido.
HTML retorna o markup mais o <script> inline usando SimpleWebAuthnBrowser; os alertas usam SuccessAlertStyle / ErrorAlertStyle.
| Todos os Componentes sgcHTMLExplore a matriz completa de recursos com mais de 60 componentes. | Abrir | |
| Baixar Versão de Avaliação GratuitaA avaliação de 30 dias inclui os projetos de demonstração 60.HTML. | Abrir | |
| PreçosLicenças Single, Team e Site com código-fonte completo. | Abrir |