Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kiselyovda/fastapi-jwt-oauth
Short project to understand OAuth JWT authentication with FastAPI
https://github.com/kiselyovda/fastapi-jwt-oauth
fastapi jwt oauth2 python
Last synced: 7 days ago
JSON representation
Short project to understand OAuth JWT authentication with FastAPI
- Host: GitHub
- URL: https://github.com/kiselyovda/fastapi-jwt-oauth
- Owner: kiselyovda
- Created: 2024-03-21T14:37:43.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-03-28T09:18:15.000Z (8 months ago)
- Last Synced: 2024-03-28T10:33:48.000Z (8 months ago)
- Topics: fastapi, jwt, oauth2, python
- Language: Python
- Homepage:
- Size: 29.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Simple OAuth authentication with FastAPI
## Stack
- [Python 3.12](https://github.com/python/cpython)
- [FastAPI](https://github.com/tiangolo/fastapi)
- [Poetry](https://github.com/python-poetry/poetry)
- [PyJWT](https://github.com/jpadilla/pyjwt)
- [bcrypt](https://github.com/pyca/bcrypt)## What i`ve done
- [x] Release JWT Token on endpoint `/auth/login`.
- [x] Get current user on endpoint `/users/me`.
- [x] Get username of user on endpoint `/users/username`.## In the future
- [ ] `PostgreSQL` connection with [SQLAlchemy 2.0+](https://github.com/sqlalchemy/sqlalchemy).
- [ ] [Alembic](https://github.com/sqlalchemy/alembic) migrations.
- [ ] Full `CRUD` operations `(CREATE, READ, UPDATE, DELETE)` with `/users` endpoint.
- [ ] `Dockerfile`.
- [ ] `docker-compose.yaml`.> [!NOTE]
> To launch app you should run:
> ```bash
> 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](./authorization//auth/README.md).