auth-security
Installation
SKILL.md
Authentication & Authorization for FastAPI
Overview
FastAPI provides built-in security utilities based on OpenAPI standards. Use OAuth2 with Password flow + JWT tokens as the standard pattern for API authentication. Combine with bcrypt for password hashing and role-based access control (RBAC) for authorization.
Key packages:
uv add "python-jose[cryptography]" passlib[bcrypt] python-multipart
# or with PyJWT instead of python-jose:
uv add PyJWT[crypto] passlib[bcrypt] python-multipart
python-joseorPyJWT-- JWT token creation and verificationpasslib[bcrypt]-- secure password hashingpython-multipart-- required for OAuth2 form data parsing