OAuthCallback

TsgcHTMLComponent_OAuthCallback — Delphi, C++ Builder 및 .NET에서 로그인한 사용자와 자동 리디렉션을 표시하며 성공, 오류 또는 로딩 상태의 OAuth 랜딩 페이지를 렌더링합니다.

TsgcHTMLComponent_OAuthCallback

OAuth 리디렉션 URI에서 제공하는 페이지입니다. Status와 사용자 세부 정보를 설정한 다음, HTML을 읽습니다 — 또는 한 줄짜리 정적 BuildSuccess, BuildErrorBuildLoading 헬퍼를 사용하십시오.

컴포넌트 클래스

TsgcHTMLComponent_OAuthCallback

렌더링

Bootstrap 5 콜백 페이지

패밀리

인증

언어

Delphi, C++ Builder, .NET

결과마다 한 줄

정적 Build* 헬퍼는 완성된 페이지를 직접 렌더링합니다. 아바타, 리디렉션 방법 또는 사용자 지정 아이콘을 설정해야 할 때는 전체 컴포넌트를 사용하십시오.

uses
  sgcHTML_Enums, sgcHTML_Component_OAuthCallback;

// Success page (with auto-redirect to /dashboard):
WebModule.Response := TsgcHTMLComponent_OAuthCallback.BuildSuccess(
  'Google', 'Jane Doe', '/dashboard', 'jane@acme.com');

// Error page:
WebModule.Response := TsgcHTMLComponent_OAuthCallback.BuildError(
  'Google', 'access_denied');

// Loading / interstitial page:
WebModule.Response := TsgcHTMLComponent_OAuthCallback.BuildLoading('Google');

// Full control:
var
  oCB: TsgcHTMLComponent_OAuthCallback;
begin
  oCB := TsgcHTMLComponent_OAuthCallback.Create(nil);
  try
    oCB.Status := csSuccess;
    oCB.ProviderName := 'Google';
    oCB.UserName := 'Jane Doe';
    oCB.UserAvatar := 'https://acme.com/u/jane.png';
    oCB.RedirectURL := '/dashboard';
    oCB.RedirectMethod := rmAutoRedirect;
    oCB.RedirectDelay := 3;
    WebModule.Response := oCB.HTML;
  finally
    oCB.Free;
  end;
end;
// includes: sgcHTML_Enums.hpp, sgcHTML_Component_OAuthCallback.hpp

// Success page (with auto-redirect to /dashboard):
String ok = TsgcHTMLComponent_OAuthCallback::BuildSuccess(
  "Google", "Jane Doe", "/dashboard", "jane@acme.com");

// Error page:
String err = TsgcHTMLComponent_OAuthCallback::BuildError(
  "Google", "access_denied");

// Loading / interstitial page:
String wait = TsgcHTMLComponent_OAuthCallback::BuildLoading("Google");

// Full control:
TsgcHTMLComponent_OAuthCallback *oCB = new TsgcHTMLComponent_OAuthCallback(NULL);
try
{
  oCB->Status = csSuccess;
  oCB->ProviderName = "Google";
  oCB->UserName = "Jane Doe";
  oCB->UserAvatar = "https://acme.com/u/jane.png";
  oCB->RedirectURL = "/dashboard";
  oCB->RedirectMethod = rmAutoRedirect;
  oCB->RedirectDelay = 3;
  String html = oCB->HTML;
}
__finally
{
  delete oCB;
}
using esegece.sgcWebSockets;

// Success page (with auto-redirect to /dashboard):
string ok = TsgcHTMLComponent_OAuthCallback.BuildSuccess(
    "Google", "Jane Doe", "/dashboard", "jane@acme.com");

// Error page:
string err = TsgcHTMLComponent_OAuthCallback.BuildError(
    "Google", "access_denied");

// Loading / interstitial page:
string wait = TsgcHTMLComponent_OAuthCallback.BuildLoading("Google");

// Full control:
var cb = new TsgcHTMLComponent_OAuthCallback();
cb.Status = TsgcHTMLOAuthCallbackStatus.csSuccess;
cb.ProviderName = "Google";
cb.UserName = "Jane Doe";
cb.UserAvatar = "https://acme.com/u/jane.png";
cb.RedirectURL = "/dashboard";
cb.RedirectMethod = TsgcHTMLOAuthRedirectMethod.rmAutoRedirect;
cb.RedirectDelay = 3;
string html = cb.HTML;

주요 속성 및 메서드

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

정적 빌더

BuildSuccess(aProviderName, aUserName, aRedirectURL, aUserEmail), BuildError(aProviderName, aErrorMessage)BuildLoading(aProviderName)는 한 번의 호출로 완성된 페이지를 렌더링합니다.

상태

StatuscsSuccess, csError 또는 csLoading을 선택합니다 — 체크, 십자 또는 스피너와 일치하는 텍스트를 표시합니다.

사용자 정보

ProviderName, UserName, UserEmailUserAvatar가 성공 카드를 채웁니다. ShowUserInfoAvatarSize가 그 표시를 제어합니다.

리디렉션

RedirectMethod(rmAutoRedirect, rmButtonOnly, rmNone) 및 RedirectDelay가 있는 RedirectURL이 로그인 후 내비게이션을 구동합니다.

아이콘 및 레이아웃

SuccessIconColorEnum, ErrorIconColorEnum, SuccessIconText, ErrorIconText(그리고 원시 *IconHTML/*IconColor)와 MaxWidth가 카드를 스타일링합니다.

출력

HTML은 콜백 카드를 반환합니다. ErrorMessage는 오류 상태에서 위험 알림을 채웁니다. OAuth 리디렉션 URI에서 제공하십시오.

계속 살펴보기

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

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

무료 체험판을 다운로드하고 Delphi, C++ Builder 또는 .NET 웹 앱에 OAuth 콜백 페이지를 추가하십시오.