Skip to content
cccskills
FreePublished on GitHub

jwt-strategy

JWT strategy: RS256/EdDSA, JWKS rotation, refresh tokens, secure storage, revocation, multi-tenant.

The English summary is being prepared. Showing the original description.

SebastianLuser/claude-code-arcane3 stars(GitHub 3 + cccskills 0)
Works withRedis

Run score Not tested

See how to install

Files included (4)

  • SKILL.md2.9 KB
  • references/anti-patterns.md1.2 KB
  • references/checklist.md663 B
  • references/implementation.md1.0 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

JWT Strategy — Educabot

Default: Web SPA → session cookie httpOnly opaca + refresh rotation. Mobile/APIs externas → JWT corto (RS256) + refresh rotado.

Algoritmos

RS256 o EdDSA (Ed25519) — asimétricos. Private key firma, public key verifica via JWKS. Prohibido: HS256 en multi-service (shared secret), alg: none.

Claims

Estándar obligatorios: iss, sub (user ID), aud, exp, iat, nbf, jti (para revocación). Custom Educabot: tenant_id, roles, scope, user_version. Menores: NUNCA email/nombre/PII — solo sub (UUID) + tenant_id.

Lifetimes

Access: 5-15 min. Refresh: 7-30 días, rotado en cada uso, en cookie httpOnly + DB.

Refresh Token Rotation

Cada POST /auth/refresh: validar → marcar como rotated_at → emitir nuevo con misma family_id + parent_jti. Refresh ya rotado llega → reuse detectado → revocar toda la family.

JWKS

/.well-known/jwks.json con claves públicas activas. Cache respetando Cache-Control (~10 min). Rotar cada 90 días: 2 kids activos durante overlap (emitir con nueva, validar con ambas). kid en JWT header.

Validación Server-side

  1. Signature contra JWKS (kid correcto)
  2. exp no vencido, nbf ya pasado
  3. iss matchea, aud incluye servicio actual
  4. jti no en blacklist (Redis)
  5. user_version matchea DB (si se usa)

Implementación

Go (golang-jwt), TS (jose), React (in-memory + cookie), React Native (expo-secure-store).

→ Read references/implementation.md for detalles por stack: Go, TS, React, React Native y CSRF

Logout

POST /auth/logout → delete refresh en DB → clear cookie (Max-Age=0) → frontend borra access in-memory. Access sigue válido hasta exp. Kill switch inmediato: jti a blacklist Redis con TTL = exp - now.

Revocación

A) Blacklist jti: Redis SET revoked:<jti> 1 EX <ttl>. +1 Redis hit/request.

B) user_version (Default Educabot): user tiene version en DB (incrementa en logout-all/password change/role change). JWT incluye user_version. Middleware compara (cacheable). Más barato a escala.

Multi-tenant

tenant_id en claims obligatorio. Backend valida que recursos pertenezcan a tenant_id del JWT. Prohibido pasar tenant_id por query/body.

Anti-patterns

→ Read references/anti-patterns.md for tabla completa (12 items) con remediación

Checklist

→ Read references/checklist.md for checklist completo (11 items)

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

Plan, design, and implement A/B tests and experiments with statistical rigor. Covers hypothesis frameworks, sample sizing, metrics, and result analysis.

The English summary is being prepared. Showing the original description.

SebastianLuser/claude-code-arcane3Updated Oct 27, 2026

Web/mobile accessibility decision guide: WCAG 2.2 AA, ARIA, keyboard nav, focus management, contrast, testing. Use for: a11y, accessibility, wcag, aria, screen reader, keyboard, contrast.

The English summary is being prepared. Showing the original description.

SebastianLuser/claude-code-arcane3Updated Oct 27, 2026

Generate, iterate, and scale ad creative for paid advertising across Google, Meta, LinkedIn, and X. Covers platform specs, creative frameworks, and quality validation.

The English summary is being prepared. Showing the original description.

SebastianLuser/claude-code-arcane3Updated Oct 27, 2026

Musica interactiva para juegos: layering vertical, re-secuenciacion horizontal, stingers, reglas de transicion con sync points, y mapeo de estados de gameplay a musica. Usar para: musica adaptativa, sistema de musica dinamica, transiciones musicales, combat music.

The English summary is being prepared. Showing the original description.

SebastianLuser/claude-code-arcane3Updated Oct 27, 2026

Design multi-agent systems, create agent architectures, define communication patterns, and build autonomous agent workflows with structured evaluation frameworks.

The English summary is being prepared. Showing the original description.

SebastianLuser/claude-code-arcane3Updated Oct 27, 2026

Inter-agent communication protocol for C-suite agent teams. Defines invocation syntax, loop prevention, isolation rules, response formats, and quality loops.

The English summary is being prepared. Showing the original description.

SebastianLuser/claude-code-arcane3Updated Oct 27, 2026

See all skills by SebastianLuser

Report a problem with this skill