OAuthCallback

TsgcHTMLComponent_OAuthCallback — render an OAuth landing page in success, error or loading state, showing the signed-in user and an automatic redirect, in Delphi, C++ Builder and .NET.

TsgcHTMLComponent_OAuthCallback

The page you serve from your OAuth redirect URI. Set the Status and user details, then read HTML — or use the static BuildSuccess, BuildError and BuildLoading helpers for a one-liner.

Component class

TsgcHTMLComponent_OAuthCallback

Renders

Bootstrap 5 callback page

Languages

Delphi, C++ Builder, .NET

One line per outcome

The static Build* helpers render a finished page directly. Use the full component when you need to set the avatar, redirect method or custom icons.

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;

Key properties & methods

The members you reach for most often.

Static builders

BuildSuccess(aProviderName, aUserName, aRedirectURL, aUserEmail), BuildError(aProviderName, aErrorMessage) and BuildLoading(aProviderName) render a finished page in one call.

Status

Status selects csSuccess, csError or csLoading — a check, a cross or a spinner, with matching copy.

User info

ProviderName, UserName, UserEmail and UserAvatar fill the success card; ShowUserInfo and AvatarSize control its display.

Redirect

RedirectURL with RedirectMethod (rmAutoRedirect, rmButtonOnly, rmNone) and RedirectDelay drive the post-login navigation.

Icons & layout

SuccessIconColorEnum, ErrorIconColorEnum, SuccessIconText, ErrorIconText (and the raw *IconHTML/*IconColor) plus MaxWidth style the card.

Output

HTML returns the callback card; ErrorMessage populates the danger alert in the error state. Serve it from your OAuth redirect URI.

Keep exploring

All sgcHTML ComponentsBrowse the full feature matrix of 60+ components.
Download Free TrialThe 30-day trial ships the 60.HTML demo projects.
PricingSingle, Team and Site licenses with full source code.

Ready to Get Started?

Download the free trial and add OAuth callback pages to your Delphi, C++ Builder or .NET web app.