developer-delphi-horse-jwt

Validate JWT Bearer tokens in Authorization headers for Delphi Horse routes.

Updated Jan 6, 2026
One-click install
npx skills add https://github.com/cslsoftwares/ParamentersORM --skill developer-delphi-horse-jwt
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: developer-delphi-horse-jwt
Source: https://github.com/cslsoftwares/ParamentersORM/tree/main/.cursor/skills/developer-delphi-horse-jwt_V1.0.0
Command: npx skills add https://github.com/cslsoftwares/ParamentersORM --skill developer-delphi-horse-jwt

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Middleware that validates JWT Bearer tokens in the Authorization header before executing the route handler for Delphi Horse-based applications. It enables seamless protection of API endpoints by enforcing token validation, subject/audience/issued-at/expiration checks, and optional per-route configuration.

Core Features & Use Cases

  • Global middleware availability via HorseJWT(secret) that protects all routes
  • THorseJWTConfig supports SkipRoutes, Header, IsRequiredSubject, IsRequiredIssuedAt, IsRequiredNotBefore, IsRequiredExpirationTime, IsRequireAudience, ExpectedAudience, and SessionClass
  • Read claims in handlers via Req.Session<TJWT> to access subject, expiration, and other claims
  • Integration with delphi-jose-jwt / JOSE.Core.JWT dependencies; supports per-route and global protection

Quick Start

Use HorseJWT with a secret to protect an endpoint by applying THorseJWTConfig with required claims and (optional) public routes.

Frequently Asked Questions about developer-delphi-horse-jwt

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I validate JWT Bearer tokens in Delphi Horse application routes?

To validate JWT Bearer tokens in Delphi Horse routes, apply the HorseJWT middleware with a secret key to intercept the Authorization header and enforce token checks before executing the route handler. It supports global middleware protection and per-route configuration.

What claims can I enforce when protecting API endpoints with JWT middleware in Delphi?

When protecting API endpoints with JWT middleware in Delphi, you can enforce claims validation including subject, issued at, expiration, audience, and not before. THorseJWTConfig allows you to mark these claims as required and specify an expected audience.

Can I exclude specific public routes from JWT authentication in my Horse web server?

Yes, you can exclude specific public routes from JWT authentication in your Horse web server by configuring the SkipRoutes property within THorseJWTConfig. This allows you to keep certain endpoints accessible without requiring an Authorization header token.

How do I access JWT claims inside a Delphi Horse route handler?

To access JWT claims inside a Delphi Horse route handler, use the Req.Session<TJWT> integration. By configuring the SessionClass property, the middleware populates the session object with parsed claims like subject and expiration for retrieval.

Do I need delphi-jose-jwt to implement token authentication in a Horse API?

Yes, you need the delphi-jose-jwt library, specifically the JOSE.Core.JWT dependency, to implement token authentication in a Horse API. This middleware integrates directly with that library to parse and validate the JSON Web Tokens.