auth-connect

Implement JWT authentication and RBAC for FastAPI backends.

Updated Dec 29, 2025
One-click install
npx skills add https://github.com/FAIQahm/hackathon_I_book --skill auth-connect
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: auth-connect
Source: https://github.com/FAIQahm/hackathon_I_book/tree/main/.claude/skills/auth-connect
Command: npx skills add https://github.com/FAIQahm/hackathon_I_book --skill auth-connect

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires PyJWT, bcrypt, fastapi, pydantic, asyncpg, psycopg2-binary, python-dotenv, python-multipart, rich, and includes scripts (resource) and assets (resource) components.

What problem does it solve?

Auth Connect provides a JWT-based authentication and authorization system for the FastAPI backend, including session management, RBAC, and API key support.

Core Features & Use Cases

  • JWT token generation and verification for secure API access.
  • Password hashing with bcrypt and RBAC-based permissions.
  • API key generation and management for service-to-service access.
  • Secure FastAPI middleware and token refresh mechanics for scalable auth.

Quick Start

Run the setup script to initialize the database, generate keys, and test token flows.

Frequently Asked Questions about auth-connect

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

FAQPage Schema
How do I implement JWT authentication and RBAC in a FastAPI backend?

You implement JWT authentication in FastAPI by configuring the JWT_SECRET and DATABASE_URL environment variables, running the setup script to initialize the Postgres database, and generating tokens for secure API access.

What is the best way to add API key generation for service-to-service access in FastAPI?

Adding API key generation for service-to-service access in FastAPI requires a system that generates and manages API keys securely alongside JWT tokens, utilizing Postgres for storage and bcrypt for hashing credentials.

Do I need a Neon or Postgres database to use JWT-based auth with FastAPI?

Yes, you need a Neon or Postgres database to use this JWT-based auth system, as it relies on the DATABASE_URL environment variable to manage users, roles, and API keys across your development and production environments.

How does token refresh work with JWT and FastAPI middleware?

Token refresh with JWT and FastAPI middleware works by securely intercepting requests, verifying the existing token validity, and issuing new tokens to maintain continuous user sessions without requiring re-authentication.

Can I use this JWT auth and RBAC system across staging and production environments?

Yes, you can use this JWT auth and RBAC system across staging and production environments, provided you configure the necessary JWT_SECRET and DATABASE_URL environment variables and define the required roles for each context.