better-auth-python

Fetch and cache JWKS to validate JWTs in FastAPI with get_current_user.

Updated Jan 2, 2026
One-click install
npx skills add https://github.com/ZoyaAfzal/Hackathon2_Todo_SDD --skill better-auth-python-zoyaafzal
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: better-auth-python
Source: https://github.com/ZoyaAfzal/Hackathon2_Todo_SDD/tree/main/.claude/skills/better-auth-python
Command: npx skills add https://github.com/ZoyaAfzal/Hackathon2_Todo_SDD --skill better-auth-python-zoyaafzal

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill enables secure JWT verification for Python/FastAPI backends by integrating with a Better Auth TypeScript server, ensuring tokens are validated against a centralized auth service.

Core Features & Use Cases

  • JWKS-based token verification with caching and automatic key rotation handling.
  • Multi-algorithm support (EdDSA, RS256, ES256) for interoperability with diverse issuers.
  • Easy integration via a FastAPI dependency get_current_user for protected routes and user data extraction.

Quick Start

Configure BETTER_AUTH_URL, install dependencies, and wire get_current_user into FastAPI routes to protect endpoints.

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 Better Auth JWTs in a Python FastAPI backend?

To verify Better Auth JWTs in a Python FastAPI backend, fetch and cache JWKS from your auth server, decode tokens across multiple algorithms, and wire the get_current_user dependency into your protected routes.

How does JWKS key rotation work when validating JWTs in FastAPI?

JWKS key rotation handling automatically fetches and caches updated public keys from the auth server, ensuring continuous JWT validation across multiple algorithms like EdDSA, RS256, and ES256 without manual key updates.

Can I use this to protect FastAPI routes and extract user data cross-service?

Yes, you can protect FastAPI routes and extract user data cross-service by applying the get_current_user dependency to endpoints, validating JWTs issued by a centralized Better Auth TypeScript server.

What is the best way to handle cross-service authentication between a TypeScript auth server and Python?

The best way to handle cross-service authentication is validating JWTs issued by the TypeScript Better Auth server in your Python backend using cached JWKS and multi-algorithm token decoding for robust security.

Do I need to configure a specific BETTER_AUTH_URL to start verifying tokens?

Yes, you need to configure the BETTER_AUTH_URL environment variable to enable your FastAPI application to locate the centralized auth server, fetch JWKS, and begin verifying tokens.