better-auth-jwt-jwks

Configures JWT and JWKS authentication between Next.js and FastAPI.

5|Updated Dec 22, 2025
One-click install
npx skills add https://github.com/MuhammedSuhaib/LevelUpSpeckit-Plus --skill better-auth-jwt-jwks
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: better-auth-jwt-jwks
Source: https://github.com/MuhammedSuhaib/LevelUpSpeckit-Plus/tree/main/Skill+SubAgents/skills/better-auth-jwt-jwks
Command: npx skills add https://github.com/MuhammedSuhaib/LevelUpSpeckit-Plus --skill better-auth-jwt-jwks

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pyjwt, cryptography, and includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve?

This Skill enables secure, scalable authentication between a Next.js frontend and a FastAPI backend using JWT and JWKS. It covers token generation, verification, JWKS endpoint setup, key rotation, and environment configuration for shared secrets.

Core Features & Use Cases

  • JWT generation & verification: Secure tokens between frontend and backend.
  • JWKS endpoint setup: Public key distribution and verification support.
  • Token rotation & security: Key rotation, expirations, and robust error handling.
  • Frontend-Backend integration: Stateless authentication with user isolation.

Quick Start

  1. Configure the frontend to generate JWTs and call the JWKS endpoint.
  2. Implement FastAPI middleware/dependency that verifies JWTs via JWKS.
  3. Protect routes and enforce user isolation with proper error handling.