Asymmetric RS256 & Public JWKS Verification
Verify user tokens locally with zero network hops using standard RSA public keys and RFC 7517 JSON Web Key Sets.
Why offline verification matters
Traditional authentication architectures require microservices and API gateways to make an HTTP request back to the auth server for every single incoming call. At scale, this creates a costly bottleneck, introduces network latency (50-200ms per request), and creates a single point of failure.
HVT signs all access tokens using asymmetric RS256 (RSA Signature with SHA-256). The private signing key never leaves HVT infrastructure, while the public verification keys are published via a standards-compliant JWKS endpoint. Downstream services cache the public keys locally and verify token signatures in less than one millisecond with zero outbound HTTP requests.
Discovery and public key endpoints
HVT exposes public keys conforming to RFC 7517 and OpenID Connect 1.0 Discovery specifications. Endpoints support CORS requests from any origin and include HTTP cache headers:
The JWKS response contains active and recently rotated RSA public keys with unique Key IDs (kid):
Token claims specification
HVT tokens embed standard OpenID Connect claims alongside project-scoped role and permission metadata. Downstream services can read permissions immediately without database queries:
Key claims available in verified payloads:
- sub: Unique end-user UUID.
- aud: Project UUID. Verifying this prevents tokens issued for one project from being accepted by another.
- sid: Session UUID. Connects the token to active session tracking and enables instant revocation.
- app_roles: List of active role slugs assigned to the user within this specific project.
- app_permissions: Flattened array of resolved permission slugs for direct RBAC evaluation.
Next.js 15 App Router Edge Middleware
Use jose to verify tokens at the Edge inside Next.js middleware. Because createRemoteJWKSet caches keys automatically, incoming requests incur zero roundtrips:
FastAPI backend verification
In Python microservices, use pyjwt[crypto] with PyJWKClient. The client caches the public key set for one hour and extracts the matching public key via the token's kid header:
Node.js & Express verification
For Node.js backends and Express services, jose provides a lightweight zero-dependency verification pipeline:
Key rotation and zero-downtime resilience
When security keys are rotated, HVT signs new tokens with the new private key and adds the corresponding public key to /.well-known/jwks.json. Existing valid tokens continue verifying against the previous key until their expiration time.
jose, PyJWKClient) automatically refetch the JWKS set whenever they encounter a token with an unknown kid, ensuring zero-downtime key rotation.