OAuthCallback
TsgcHTMLComponent_OAuthCallback — renderize uma página de destino OAuth em estado de sucesso, erro ou carregamento, mostrando o usuário autenticado e um redirecionamento automático, em Delphi, C++ Builder e .NET.
TsgcHTMLComponent_OAuthCallback — renderize uma página de destino OAuth em estado de sucesso, erro ou carregamento, mostrando o usuário autenticado e um redirecionamento automático, em Delphi, C++ Builder e .NET.
A página que você serve a partir do seu URI de redirecionamento OAuth. Defina o Status e os detalhes do usuário e então leia HTML — ou use os helpers estáticos BuildSuccess, BuildError e BuildLoading para uma linha única.
TsgcHTMLComponent_OAuthCallback
Página de callback do Bootstrap 5
Delphi, C++ Builder, .NET
Os helpers estáticos Build* renderizam uma página finalizada diretamente. Use o componente completo quando precisar definir o avatar, o método de redirecionamento ou ícones personalizados.
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;
Os membros que você usa com mais frequência.
BuildSuccess(aProviderName, aUserName, aRedirectURL, aUserEmail), BuildError(aProviderName, aErrorMessage) e BuildLoading(aProviderName) renderizam uma página finalizada em uma chamada.
Status seleciona csSuccess, csError ou csLoading — um check, um X ou um spinner, com o texto correspondente.
ProviderName, UserName, UserEmail e UserAvatar preenchem o card de sucesso; ShowUserInfo e AvatarSize controlam sua exibição.
RedirectURL com RedirectMethod (rmAutoRedirect, rmButtonOnly, rmNone) e RedirectDelay conduzem a navegação pós-login.
SuccessIconColorEnum, ErrorIconColorEnum, SuccessIconText, ErrorIconText (e os brutos *IconHTML/*IconColor) mais MaxWidth estilizam o card.
HTML retorna o card de callback; ErrorMessage popula o alerta de perigo no estado de erro. Sirva-o a partir do seu URI de redirecionamento OAuth.
| 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 |