JWT JSON Web Tokens

JSON Web Token (JWT) support in sgcWebSockets. Create, sign, verify, and decode JWTs for secure authentication and authorization.

Capabilities

  • Create and sign JWTs with HS256, RS256, ES256 algorithms
  • Verify token signatures and expiration
  • Custom claims and registered claims support
  • JWK and JWKS key management
  • Compact serialization format

Delphi Example

uses
  sgcHTTP_JWT;

var
  JWT: TsgcHTTPJWT;
begin
  JWT := TsgcHTTPJWT.Create(nil);
  JWT.Header.Algorithm := jwtRS256;
  JWT.Payload.Issuer := 'my-app';
  JWT.Payload.Subject := 'user-123';
  JWT.Payload.ExpirationTime := Now + 1/24;
  Token := JWT.Compact(PrivateKey);
end;

Ready to Work with JWT?

Download the free trial and start building in minutes.