Flask Auth Testing Kit is a ready-to-use authentication API built with Flask, designed for developers and testers who want to automate API authentication workflows. It provides a simple implementation of JWT authentication, PKCE (Proof Key for Code Exchange), and token management, making it ideal for learning, testing, and automation.
This project is a Flask-based authentication API that implements JWT-based authentication and PKCE (Proof Key for Code Exchange). It includes:
- User authentication with username and password.
- JWT token generation and verification.
- User logout and token revocation.
- Running the app locally using a virtual environment.
- Running the app using Docker and Docker Compose.
- JWT Authentication using
flask_jwt_extended
- User Management with hashed passwords
- PKCE (Proof Key for Code Exchange)
- Token Revocation for secure logout
- Docker & Docker Compose for easy deployment
- Python 3.8+
- Flask
- PostgreSQL
- Docker & Docker Compose
$ git clone [email protected]:anandhuk/flask-auth-testing-kit.git
$ cd flask-auth-testing-kit
$ python3 -m venv venv
$ source venv/bin/activate # For Linux/macOS
$ venv\Scripts\activate # For Windows
$ pip install -r requirements.txt
Update the .env
file in the project root
$ python setup_db.py
$ python run.py
API will be available at http://127.0.0.1:5000
$ docker build -t flask-auth-api .
$ docker run -p 5000:5000 flask-auth-api
API will be available at http://127.0.0.1:5000
$ docker-compose up --build
API will be available at http://127.0.0.1:5000
Method | Endpoint | Description |
---|---|---|
GET | /authorize |
PKCE-based authentication |
POST | /token |
Obtain JWT tokens (access & refresh) |
GET | /user |
Fetch user details (JWT required) |
POST | /logout |
Revoke access token |
- Add user registration endpoint
- Implement role-based access control (RBAC)
- Add OAuth2 authentication support
- Improve logging and error handling
- Create front-end UI for authentication
This project is licensed under the MIT License. See LICENSE
for details.
Pull requests are welcome! If you find any issues, please open an issue or submit a PR.
For any questions or support, contact Anandhu Krishnan G at [email protected].
Happy coding! 🚀