Posts Tagged: authentication
-
How to Test Flask Endpoints That Require Authentication Without Hitting the Database
Flask auth endpoint testing without DB: Mock Flask-Login user_loader, pytest fixtures for test_client + fake user. Parallel-safe (500 tests/s), zero flakes/DB setup. Full app+tests code. Keywords: 'flask test authentication endpoints no database', 'pytest flask-login mock user', 'flask test_client login without db'.
-
Implementing OAuth2 with Password Flow in FastAPI: Complete JWT Token Example
Implement OAuth2 password flow in FastAPI with JWT tokens: secure authentication using PyJWT and passlib, including login endpoint, protected routes, and curl tests with a fake user database.