Authenticating a Flask API can be achieved using JWTs (JSON Web Tokens). In this Flask JWT authentication crash course we will cover everything from password hashing, creating access tokens, refresh tokens, authenticating users as well as revoking access tokens.
Chapters:
0:00 Intro
0:53 Installing dependencies
1:48 Configuring dependencies
6:26 Registering a user
17:42 Getting access and refresh tokens
24:22 Refreshing the access token
27:21 Changing token expiry
28:10 Saving tokens in the database
37:28 Revoking access and refresh tokens
48:33 Loading the user from the token
Code:
https://github.com/demoskp/flask-jwt-...
Personal website:
http://www.petsas.consulting