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 — 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.
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.
TsgcHTMLComponent_OAuthCallback
Bootstrap 5 callback page
Delphi, C++ Builder, .NET
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;
The members you reach for most often.
BuildSuccess(aProviderName, aUserName, aRedirectURL, aUserEmail), BuildError(aProviderName, aErrorMessage) and BuildLoading(aProviderName) render a finished page in one call.
Status selects csSuccess, csError or csLoading — a check, a cross or a spinner, with matching copy.
ProviderName, UserName, UserEmail and UserAvatar fill the success card; ShowUserInfo and AvatarSize control its display.
RedirectURL with RedirectMethod (rmAutoRedirect, rmButtonOnly, rmNone) and RedirectDelay drive the post-login navigation.
SuccessIconColorEnum, ErrorIconColorEnum, SuccessIconText, ErrorIconText (and the raw *IconHTML/*IconColor) plus MaxWidth style the card.
HTML returns the callback card; ErrorMessage populates the danger alert in the error state. Serve it from your OAuth redirect URI.