Hey guys, In this video we see how to implement JWT Authentication with FastAPI-JWT-Auth extension. FastAPI extension that supports JWT Authentication (safe, simple to use, and lightweight). If you're acquainted with flask-jwt-extended, this extension is for you.
In this video, I walk through how we implement the following.
Creating Access tokens and refresh tokens
Creating Freshness Tokens
Protecting routes and so on.
Timestamps
0:00 Introduction
3:00 Creating Routes
5:06 Creating the model with Pydantic
6:07 Optional configurations
7:54 Creating users in a list
10:49 Get all users
14:43 Configuring FastAPI-JWT-Auth extension
19:10 Creating access tokens
19:52 Creating a login model with Pydantic
27:49 Raising Http Exceptions
29:17 Protecting JWT required routes
33:07 Getting User identity
33:43 Accessing protected routes
35:59 Creating refresh tokens
38:26 Using Refresh tokens to create new tokens
40:20 Protect a route for only refresh tokens
41:40 Create new access token
42:25 Creating freshness token
48:45 Protecting freshness token required routes
54:13 Wrapping up
FastAPI JWT Auth Extension website:
https://indominusbyte.github.io/fasta...
SOURCE CODE FOR THIS VIDEO:
https://github.com/jod35/using-fastap...
FOLLOW ME:
Twitter: / jod35_
Github: https://github.com/jod35