Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/epic-r-r/fastapi-jwt-authentication
https://github.com/epic-r-r/fastapi-jwt-authentication
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/epic-r-r/fastapi-jwt-authentication
- Owner: Epic-R-R
- Created: 2024-03-07T06:52:11.000Z (10 months ago)
- Default Branch: master
- Last Pushed: 2024-03-07T07:02:48.000Z (10 months ago)
- Last Synced: 2024-03-08T07:50:36.314Z (10 months ago)
- Language: Python
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# FastAPI JWT Authentication
## Overview
This project showcases a secure authentication implementation using FastAPI, OAuth2, and JWT (JSON Web Tokens). The tutorial covers token generation, user validation, and integration with OAuth2 for password bearer authentication.
## Features
- **Token Generation:** Create secure access tokens for user authentication.
- **User Validation:** Implement methods to validate user credentials for secure access.
- **OAuth2 Integration:** Utilize OAuth2 for password bearer authentication in FastAPI.
- **JWT Encoding:** Explore JWT for encoding and decoding tokens with a custom secret key and algorithm.
- **Password Hashing:** Enhance security with bcrypt password hashing.
- **Dependency Injection:** Seamless integration of authentication checks using FastAPI's dependency injection.## Getting Started
1. Clone the repository:
```bash
git clone https://github.com/Epic-R-R/fastapi-jwt-authentication.git
cd fastapi-jwt-authentication
```
2. Install dependencies:```bash
pip install -r requirements.txt
```
1. Run the FastAPI application:```bash
hypercorn main:app --worker-class trio
```Access the API documentation at ```http://127.0.0.1:8000/docs``` and explore the implemented endpoints.