WebAuthnLogin

TsgcHTMLComponent_WebAuthnLogin — Delphi, C++ Builder 및 .NET에서 SimpleWebAuthn 기반 JavaScript를 내보내는 비밀번호 없는 패스키/WebAuthn 로그인 및 등록 위젯입니다.

TsgcHTMLComponent_WebAuthnLogin

등록 및 로그인 버튼과 브라우저 측 스크립트를 렌더링하는 패스키 위젯입니다. SimpleWebAuthnBrowser를 통해 사용자의 /options/verify 엔드포인트와 통신합니다. 모드와 URL을 설정한 다음, HTML을 읽습니다 — 또는 정적 Build 헬퍼를 사용하십시오.

컴포넌트 클래스

TsgcHTMLComponent_WebAuthnLogin

렌더링

Bootstrap 5 마크업 + WebAuthn JS

패밀리

인증

언어

Delphi, C++ Builder, .NET

한 줄, 또는 완전한 제어

정적 Build 헬퍼는 단일 호출로 위젯을 렌더링합니다. 사용자 지정 제목, 사용자 이름 선택기 또는 자체 스크립트가 필요할 때는 전체 컴포넌트를 사용하십시오.

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

주요 속성 및 메서드

가장 자주 사용하게 되는 멤버.

정적 빌더

Build(aMode, aRegisterURL, aAuthenticateURL)는 모드와 엔드포인트에 대한 합리적인 기본값으로 한 번의 호출에 위젯 전체를 렌더링합니다.

모드

ModewamRegister, wamAuthenticate 또는 wamBoth를 선택하여 어떤 버튼이 나타날지 결정합니다.

엔드포인트

RegisterURLAuthenticateURL은 서버의 베이스입니다(스크립트가 /options/verify를 추가합니다). CallbackURL은 성공적인 로그인이 도달하는 곳입니다.

버튼 및 텍스트

RegisterButtonText, AuthenticateButtonText, RegisterButtonStyle, AuthenticateButtonStyle, Title, DescriptionShowPasskeyIcon이 UI를 구성합니다.

스크립트 및 사용자 이름

UsernameSelector는 등록 전에 필드에서 사용자 이름을 읽습니다. CustomScript는 내장 SimpleWebAuthn JavaScript를 완전히 대체합니다.

출력

HTMLSimpleWebAuthnBrowser를 사용하는 인라인 <script>와 함께 마크업을 반환합니다. 알림은 SuccessAlertStyle / ErrorAlertStyle을 사용합니다.

계속 살펴보기

모든 sgcHTML 컴포넌트60개 이상의 컴포넌트 전체 기능 매트릭스를 둘러보십시오.
무료 체험판 다운로드30일 체험판에는 60.HTML 데모 프로젝트가 포함됩니다.
가격전체 소스 코드가 포함된 Single, Team 및 Site 라이선스.

시작할 준비가 되셨습니까?

무료 체험판을 다운로드하고 Delphi, C++ Builder 또는 .NET 웹 앱에 패스키 로그인을 추가하십시오.