better-auth-python

Validate Better Auth JWTs with JWKS and RS256 for FastAPI backends.

Updated Feb 8, 2026
One-click install
npx skills add https://github.com/abdulahad139/Todoapp-HackathonII --skill better-auth-python-abdulahad139
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: better-auth-python
Source: https://github.com/abdulahad139/Todoapp-HackathonII/tree/main/.claude/skills/better-auth-python
Command: npx skills add https://github.com/abdulahad139/Todoapp-HackathonII --skill better-auth-python-abdulahad139

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Better Auth JWT verification for Python/FastAPI backends to securely validate tokens issued by the Better Auth service, simplifying backend authentication.

Core Features & Use Cases

  • JWKS-based token verification for RS256 signed tokens.
  • Seamless FastAPI dependency integration for protected routes.
  • Backend-template support for SQLModel and SQLAlchemy data layers.

Quick Start

Install the required libraries, configure BETTER_AUTH_URL, and wire get_current_user into your FastAPI routes.

Frequently Asked Questions about better-auth-python

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

FAQPage Schema
How do I validate Better Auth JWTs in a FastAPI backend?

To validate Better Auth JWTs in a FastAPI backend, use JWKS and RS256 signature verification by wiring a get_current_user dependency into your routes, requiring pyjwt and cryptography to securely parse tokens.

What is JWKS caching and why is it needed for Python authentication?

JWKS caching stores JSON Web Key Set data locally to avoid repeatedly fetching public keys from BETTER_AUTH_URL, ensuring secure RS256 token verification while maintaining backend authentication performance.

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

Yes, Better Auth JWT verification supports backend templates for both SQLModel and SQLAlchemy data layers, allowing you to integrate verified user identities directly into your preferred Python ORM workflow.

What Python libraries are required to verify RS256 signed JWTs?

Verifying RS256 signed JWTs requires the pyjwt library for token decoding, cryptography for signature handling, and httpx to fetch JWKS data from your configured BETTER_AUTH_URL endpoint.

How do I protect FastAPI routes with token authentication?

Protect FastAPI routes with token authentication by integrating a dependency that checks Better Auth JWTs, validating RS256 signatures against JWKS to ensure only authorized users access protected endpoints.

Why does my FastAPI JWT validation fail when fetching JWKS?

FastAPI JWT validation fails fetching JWKS if BETTER_AUTH_URL is misconfigured or network requests lack proper httpx setup, preventing the backend from retrieving RS256 public keys needed for secure token verification.