eSeGeCe — Enterprise Communication Components for Delphi & .NET
FEATURED · sgcAuth

OAuth2 and JWT, native in Delphi

Two components carry the token side of modern authentication into your application. TsgcHTTP_OAuth2_Client runs the Authorization Code, PKCE, Client Credentials, Resource Owner Password and Device Code grants against any OAuth2/OIDC provider. TsgcHTTP_JWT_Client builds, signs and verifies JSON Web Tokens, on its own or as the Bearer token source for your WebSocket and HTTP clients. Standalone, the sgcWebSockets Core runtime is included.

  • 2 client components
  • OAuth2 · JWT · WebAuthn
  • 9 RFCs implemented
  • Delphi 7 to 13 · C++ Builder

Two Components, the Whole Token Lifecycle

sgcAuth is a standalone package. It bundles the sgcWebSockets Core runtime it is built on, and every license ships with full source code, so the token exchanges step through in your own debugger.

2 Client components TsgcHTTP_OAuth2_Client and TsgcHTTP_JWT_Client, on one palette page.
9 RFCs implemented OAuth2, PKCE, DPoP, Device Code, JWT/JWS/JWE and more.
5 Target platforms Windows, macOS, Linux 64-bit, iOS and Android from one source tree.
1 Standalone installer The sgcWebSockets Core runtime and the HTTP/TLS layer both ship inside the package.
100% Source code included Every license carries the full source of both components and the bundled runtime.
sgcAuth

OAuth2 client, JWT client and WebAuthn passkey support for Delphi and C++ Builder. A standalone package with the sgcWebSockets Core runtime bundled in, full source code, and royalty-free deployment.

One Component per Job, One API Style

Drop a component on a form, set the provider or key details, wire the events, then call Start or Sign. The naming is consistent across both, so an authentication flow reads the same whichever grant or algorithm it uses.

OAuth2

Five Grant Types, One Component

TsgcHTTP_OAuth2_Client drives OAuth2Options.GrantType through auth2Code for trusted server-side apps, auth2CodePKCE for native, mobile and single-page apps, auth2ClientCredentials for daemons and service accounts, auth2ResourceOwnerPassword, and auth2DeviceCode (RFC 8628) for smart TVs, kiosks and other input-constrained devices. Start opens the system browser and stands up a small local HTTP server from LocalServerOptions to catch the redirect, exchanging the code for a token over plain HTTPS. Refresh, Revoke and Introspect cover the token lifecycle after that, and DPoPOptions adds proof-of-possession (RFC 9449) for providers that require it.

View the OAuth2 client →
JWT

Sign, Attach or Verify, Your Choice

TsgcHTTP_JWT_Client publishes everything RFC 7519 needs through JWTOptions: the JOSE Header, the registered Payload claims (iss, sub, aud, exp, nbf, iat, jti, plus custom claims), and the key material for HMAC, RSA and ECDSA. Call Sign for the compact-serialization token directly, or set RefreshTokenAfter and let the component re-sign automatically. The same component plugs straight into Authentication.Token.JWT on TsgcWebSocketClient, TsgcHTTP1Client and TsgcHTTP2Client, so every outbound request carries a fresh Bearer token.

View the JWT client →
WebAuthn

Passkeys, via sgcCustomIndy

Passwordless sign-in is served by TsgcWSAPIServer_WebAuthn, a sgcWebSockets Enterprise/All-Access component built on the patched Indy library that sgcCustomIndy ships as an add-on. It is added automatically when you order sgcAuth.

See what it can do →
Use cases

Sign-In, Service Accounts and Your Own APIs

Sign in with Google or Microsoft, server-to-server API access, smart TVs and kiosks, long sessions without re-prompting, and Bearer tokens for your own WebSocket and HTTP APIs. Both components run happily inside a VCL or FMX application, a service or a console process.

The feature matrix →
Cross-platform

Pure HTTPS and Signing, No Native Library

Neither component depends on anything beyond the Core runtime's HTTP client stack and the platform's crypto primitives, so both compile and run wherever Delphi does. From Delphi 7 through RAD Studio 13 and on C++ Builder.

The feature matrix →

Reference pages for each component:

Get a Token, Sign a Token

Configure the options, then call a method. Both components compile in Delphi 7 to 13 and C++ Builder, and the same properties are exposed on .NET.

uses
  sgcHTTP_OAuth2_Client;
var
  OAuth2: TsgcHTTP_OAuth2_Client;
begin
  OAuth2 := TsgcHTTP_OAuth2_Client.Create(nil);
  OAuth2.OAuth2Options.GrantType := auth2CodePKCE;
  OAuth2.OAuth2Options.ClientId := 'your-client-id';
  OAuth2.AuthorizationServerOptions.AuthURL := 'https://provider.com/oauth2/authorize';
  OAuth2.AuthorizationServerOptions.TokenURL := 'https://provider.com/oauth2/token';
  OAuth2.AuthorizationServerOptions.Scope.Text := 'openid profile';
  OAuth2.LocalServerOptions.IP := '127.0.0.1';
  OAuth2.LocalServerOptions.Port := 8080;

  OAuth2.OnAfterAccessToken := OAuth2AccessToken;
  OAuth2.Start;   // opens the browser; the redirect lands on the local server
end;

procedure TForm1.OAuth2AccessToken(Sender: TObject);
begin
  Memo1.Lines.Add('Access token received.');
end;
uses
  sgcHTTP_JWT_Client;
var
  JWT: TsgcHTTP_JWT_Client;
begin
  JWT := TsgcHTTP_JWT_Client.Create(nil);
  JWT.JWTOptions.Header.alg := jwtHS256;
  JWT.JWTOptions.Algorithms.HS.Secret := '79F66F1E-E998-436B-8A0A-3E5DEFA4FD9E';
  JWT.JWTOptions.Payload.iss := 'your-service';
  JWT.JWTOptions.Payload.sub := '1234567890';
  JWT.JWTOptions.Payload.iat := DateTimeToUnix(Now);

  ShowMessage(JWT.Sign);

  // or attach it to a WebSocket / HTTP client directly:
  // Client.Authentication.Token.Enabled := True;
  // Client.Authentication.Token.JWT := JWT;
end;

The same shape in Object Pascal and in C++ Builder. The full feature matrix →

Three Things Worth Knowing First

What sgcAuth needs from you, whether you already own these components, and what WebAuthn needs on top. All three answers are short, and all three are on this page rather than in the small print.

Components and grants
job          component                grants / algorithms
OAuth2       TsgcHTTP_OAuth2_Client   Code, PKCE, Client Credentials,
                                       Resource Owner Password, Device Code
JWT          TsgcHTTP_JWT_Client      HS256/384/512, RS256/384/512, ES256/384/512

already own it?
Both the OAuth2 Client and the JWT Client ship inside
  sgcWebSockets from the Standard edition up.
sgcAuth is for licensing OAuth2 + JWT without a full
  sgcWebSockets edition.

sgcAuth is standalone

Standalone, the sgcWebSockets Core runtime is included: the HTTP/TLS client stack both components POST their token requests through, and the JSON machinery that parses the responses. One installer, full source code in the box.

Already in your sgcWebSockets edition?

Both the OAuth2 Client and the JWT Client ship inside sgcWebSockets from the Standard edition up, so if you own any sgcWebSockets edition you already have both components. sgcAuth exists for the opposite case: OAuth2 and JWT client support without licensing a full sgcWebSockets edition.

WebAuthn needs sgcCustomIndy

Passwordless sign-in with WebAuthn is served by TsgcWSAPIServer_WebAuthn, a sgcWebSockets Enterprise/All-Access component built on the patched Indy library that sgcCustomIndy ships as an add-on. WebAuthn requires the sgcCustomIndy add-on, which is added automatically when you order sgcAuth. Already own a sgcCustomIndy license? Remove the automatically added line from your cart before checkout, no extra charge either way.

Delphi and C++ Builder

sgcAuth targets Delphi 7 through RAD Studio 13 and C++ Builder. The free trial installer is the sgcWebSockets All-Access trial, so both components can be evaluated today.

PKCE Device Code DPoP HMAC · RSA · ECDSA Full source

Every component and property →

sgcAuth speaks the published OAuth2/OIDC and JWT/JWS standards rather than wrapping a vendor SDK, so the provider is your choice: Google, Microsoft, Auth0, Okta, Keycloak, or any RFC-compliant authorization server. Grants, refresh, revocation and signing are all first-class methods and events, and full source code means nothing in between is a black box.

Twelve Libraries, One Toolbox

sgcAuth is one of twelve eSeGeCe component libraries for Delphi, C++ Builder and .NET. They share conventions, they ship with full source, and they deploy royalty-free.

sgcAuth

OAuth2 client, JWT client and WebAuthn support for Delphi and C++ Builder. Standalone, with the sgcWebSockets Core runtime bundled in.

Learn more →

sgcHTTP

HTTP/2 client, gRPC client and Google Cloud Pub/Sub, Calendar and FCM clients for Delphi and C++ Builder. Standalone, with the sgcWebSockets Core runtime bundled in.

Learn more →

sgcWebSockets

WebSocket, HTTP/2, MQTT, AMQP, WebRTC, AI and 30+ API integrations for Delphi, C++ Builder, Lazarus and .NET. This is where the Core runtime lives.

Learn more →

sgcMQ

MQTT, AMQP 0.9.1 and 1.0, Apache Kafka and STOMP client components for Delphi and C++ Builder. Standalone, with the sgcWebSockets Core runtime bundled in.

Learn more →

sgcSocial

Telegram and WhatsApp Business client components for Delphi and C++ Builder. Standalone, with the sgcWebSockets Core runtime bundled in.

Learn more →

sgcHTML

Server-side HTML and UI components on Bootstrap 5 and htmx, including a WebAuthn login UI component.

Learn more →

sgcQUIC

Raw QUIC transport and an HTTP/3 client and server, with WebTransport. An add-on to sgcWebSockets Enterprise.

Learn more →

sgcAI

AI, LLM and MCP components for Delphi and C++ Builder. Seven LLM providers behind one component, plus MCP, embeddings and speech. Standalone, with the sgcWebSockets Core runtime bundled in.

Learn more →

sgcOpenAPI

OpenAPI 3.x parser, native Pascal SDK generator, OpenAPI server component, and 1,195+ pre-built cloud SDKs.

Learn more →

sgcSign

XAdES, PAdES, CAdES and ASiC for documents, Authenticode, ClickOnce, NuGet and VSIX for code.

Learn more →

sgcBiometrics

Windows Hello, fingerprint sensors and the Windows Biometric Framework for Delphi and C++ Builder.

Learn more →

sgcIndy

Updated Indy TCP/IP components with modern TLS, IPv6 and HTTP/2 for Delphi 7 through 13.

Learn more →

View pricing and licenses Download the free trial

What Developers Say

Trusted by Delphi, C++ Builder, Lazarus and .NET developers around the world.

Your sgcWebSockets library is very useful and easy to setup. Keep up the good work!

Simone Moretti Delphi Developer

sgcWebSockets is amazing and your support is the best!

Christian Meyer Founder & CTO

Thanks so much for your help and support, I love your components.

Mark Steinfeld CTO

Latest from the blog

View all posts →

You are seeing the Authentication view of eSeGeCe.

Show me another angle →
30-Day Money-Back GuaranteeNot satisfied? Request a full refund within 30 days of purchase. See refund policy

Ship Authentication, Not a Token Library

OAuth2 and JWT in one package, with the sgcWebSockets Core runtime bundled in and full source code in the box.