Skip to content
Back to skills

Jwt Security

ASecurity

Issue and validate JWTs safely with strict alg pinning, JWKS rotation, short TTLs, and refresh token revocation

  • 5 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 30, 2026
developmentrustgodatabasebackendsecurity

Security analysis

A100/100

Scanned November 30, 2026

npx -y skills add AdityaaaTiwari/ANVIL --skill jwt-security --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Jwt Security?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Jwt Security
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/adityaaatiwari-jwt-security/badge)](https://www.skillsdirectory.com/skills/adityaaatiwari-jwt-security)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
description: Issue and validate JWTs safely with strict alg pinning, JWKS rotation, short TTLs, and refresh token revocation
profile: standard
tags: auth, security, jwt, backend
---

# JWT security

Use when issuing access/refresh tokens, configuring JWKS verification, or auditing stateless authentication middleware.

## Token validation
- Always pin explicit expected signing algorithms (`["RS256"]` or `["EdDSA"]`) in verification options—never allow `none` or mix symmetric `HS256` with public keys via untrusted headers.
- Validate `iss` (issuer), `aud` (audience), `exp`, and `nbf` strictly on every request, ignoring unverified header `jku`/`x5u` URLs from tokens.
- Keep JWT access token TTLs short (`5–15` minutes) and exclude PII or secrets from unencrypted JWT claims.

## Rotation and revocation
- Support overlapping signing keys in JWKS (`kid`) cleanly during key rotation with bounded cache refresh on unknown `kid`.
- Store opaque refresh tokens hashed (SHA-256) in the database, rotate on every use (`refresh token rotation`), and revoke the entire token family immediately if reuse is detected.

## Verify
Test `alg: none` forgery, wrong `aud`/`iss`, expired tokens, key rotation rollover, and refresh-token reuse detection.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.