/fastapi-jwt-oauth

Short project to understand OAuth JWT authentication with FastAPI

Primary LanguagePython

Simple OAuth authentication with FastAPI

Stack

What i`ve done

  • Release JWT Token on endpoint /auth/login.
  • Get current user on endpoint /users/me.
  • Get username of user on endpoint /users/username.

In the future

  • PostgreSQL connection with SQLAlchemy 2.0+.
  • Alembic migrations.
  • Full CRUD operations (CREATE, READ, UPDATE, DELETE) with /users endpoint.
  • Dockerfile.
  • docker-compose.yaml.

Note

To launch app you should run:

mv .env.example .env
python3 -m venv venv
source venv/bin/activate
(venv) pip install poetry
(venv) poetry install
(venv) uvicorn authorization.main:app --host localhost --port 8000 --reload

Note

To make private and public keys check up this file.