better-auth-python

Verify Better Auth JWT tokens in Python FastAPI backends using JWKS and RS256.

2|Updated Dec 7, 2025
One-click install
npx skills add https://github.com/ayesha-aziz123/Hackathon_II --skill better-auth-python-ayesha-aziz123
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: better-auth-python
Source: https://github.com/ayesha-aziz123/Hackathon_II/tree/main/Evolution-Todo/.claude/skills/better-auth-python
Command: npx skills add https://github.com/ayesha-aziz123/Hackathon_II --skill better-auth-python-ayesha-aziz123

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides a ready-to-use pattern for securely verifying Better Auth JWTs in Python/FastAPI apps by automatically fetching and caching JWKS keys and validating tokens for protected routes.

Core Features & Use Cases

  • JWKS-based JWT verification using RS256 for FastAPI endpoints.
  • Seamless integration with SQLModel and SQLAlchemy data access patterns.
  • Protected routes with a lightweight dependency for retrieving the current user.

Quick Start

  • Install dependencies: pip install fastapi uvicorn pyjwt cryptography httpx
  • Run a sample app with a get_current_user dependency and a protected route using JWT verification

Frequently Asked Questions about better-auth-python

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

FAQPage Schema
How do I verify JWT tokens in a FastAPI application?

JWT token verification in FastAPI uses JWKS-based validation to securely check token signatures. This Skill automates JWKS key fetching and RS256 signature verification, enabling protected routes through a lightweight dependency that extracts and validates tokens before passing requests to your endpoints.

Can I use Better Auth JWT verification with SQLModel and SQLAlchemy?

Yes. This Skill integrates seamlessly with SQLModel and SQLAlchemy data access patterns, allowing you to combine JWT verification with database queries in protected routes and retrieve authenticated user data in a single dependency.

What's the fastest way to set up secure FastAPI endpoints with JWT protection?

Install fastapi, uvicorn, pyjwt, cryptography, and httpx, then use the provided get_current_user dependency to protect routes. The Skill handles JWKS caching and token validation automatically, reducing setup to a few lines of code per endpoint.

Do I need to manually fetch and cache JWKS keys for token verification?

No. This Skill automatically fetches and caches JWKS keys from Better Auth, eliminating manual key management. Token verification happens transparently through the FastAPI dependency injection system without additional configuration.

What authentication approach should I use if my FastAPI backend needs RS256 JWT validation?

RS256 JWT validation using JWKS is ideal for distributed systems where public keys are fetched dynamically. This Skill provides a production-ready pattern for Better Auth token verification, including key caching and dependency-based route protection.

Related Skills