Skip to content

Robust REST API authentication using Flask and JWT Includes token generation, refresh and protected endpoints

Notifications You must be signed in to change notification settings

fahadai-dev/flask-jwt-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

🔐 JWT Authentication API

Professional REST API with JWT authentication for Flask applications.

✨ Features

  • ✅ User registration with password hashing
  • ✅ Login with JWT access & refresh tokens
  • ✅ Protected routes
  • ✅ Token refresh mechanism
  • ✅ Logout with token blacklist
  • ✅ SQLite database

🚀 Quick Start

pip install flask flask-jwt-extended flask-sqlalchemy werkzeug
python app.py

📡 API Endpoints

Register:

POST /register
{
  "username": "john",
  "email": "john@test.com",
  "password": "pass123"
}

Login:

POST /login
{
  "username": "john",
  "password": "pass123"
}

Protected Route:

GET /profile
Headers: Authorization: Bearer YOUR_ACCESS_TOKEN

💻 Tech Stack

  • Python 3.x
  • Flask
  • Flask-JWT-Extended
  • SQLAlchemy

📫 Contact

For custom API development: fahad.integration.ml@gmail.com

⭐ If you find this useful, please star this repo!

About

Robust REST API authentication using Flask and JWT Includes token generation, refresh and protected endpoints

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages