Creating a RESTFul API in Flask With JSON Web Token Authentication and Flask-SQLAlchemy

preview_player
Показать описание
This video shows an example of a todo list RESTFul API being created using Flask. This API using Flask-SQLAlchemy and is authenticated using JSON Web Tokens. This is a much more realistic example of how a token-based API will behave, but like any educational example, there's always so much more you can add.

Before watching this video, you may want to understand JSON Web Tokens (JWT), Flask-SQLAlchemy, general Flask principles, and the ideas before RESTFul APIs.

Рекомендации по теме
Комментарии
Автор

Man, I didn't understand JWT, and I barely understood the SQLAlchemy ORM. Now I now what both do. I was doing it all by myself. You changed my life and hopefully with my project done you got me a success in a job interview. Everything you explained was totally clear, very well detailed. I loved it!

yeagerdd
Автор

UPDATE ON CODE using Python3 & PyJWT:
for encoding use

token = jwt.encode({'public_id': user.public_id, 'exp': datetime.datetime.utcnow()+datetime.timedelta(minutes=30)}, app.config['SECRET_KEY'], algorithm="HS256")

for decoding use

data = jwt.decode(token, app.config['SECRET_KEY'], algorithms=["HS256"])

basically just adding the ALGORITHM and ALGORITHMS=[] parts... otherwise it gave me error (token invalid for operations after the log-in), but this fixed it.

check you don't have both jwt and PyJWT packages:
pip3 list

if you have both:
pip3 uninstall jwt
pip3 uninstall PyJWT
pip3 install PyJWT

re-run your app

I Hope this helps!

rafaelgramoschi
Автор

This tutorial is definitely one of the best masterpieces that you can find rarely .

altughanozengi
Автор

One of the best tutorial videos I have ever watched. Very smooth and concise presentation, speedy but still easy to follow. Kudos!

makkurotatsu
Автор

The best tutorial for JWT implementation on Flask. Really easy and practical.

PulkitKumar
Автор

One of the best video tutorial I have watched about Flask API.... Thank you for maintaining the pace by just giving, to the point and relative information of each step of code.

alibaloch
Автор

an excellent video to get started man! Sorry for getting 3 years later to the party! Thanks for putting this out! Keep it up, one day every effort you've made will pay you off!

dimasveliz
Автор

one of the best tutorials over youtube. excellent content delivered in a great fashion, I'd say that is getting a bit more confusing during the wrapper phase, but besides that everything is just great!

thedemonlord
Автор

Watching this I realize I can actually understand stuff if it's explained well. Thank you so much

nailakaliyeva
Автор

Thanks a lot for this amazing tutorial!
I was learning Oauth OIDC and concepts on third party sign in. There was a missing piece on how to access code is useful.
Your tutorial fills the gap for me. Thank you!

opclass
Автор

I was having really hard time learning token based authentication. it was like months of struggle ended with one tutorial video. Thanks :)

krupeshanadkat
Автор

No exaggeration to say that this video changed my life, thank you so much.

flow_
Автор

Completely followed. One of the best video with complete API that can be further pushed to PROD.

VaibhavYadav
Автор

Another great Video for flask devs! Just what I was looking for, thanks a lot for the great content!

kennyaires
Автор

I don't use flask but I was rolling my own JWT authenticator using API Gateway and Lambda on AWS and these tutorials helped me a ton. Thanks!

wywarren
Автор

this video is by far the best Flask authentication content I have found that you so much!

dankingswell
Автор

Thank you Anthony. You are the man. You made me understand python decorators better.

antonyinjila
Автор

This is the best tutorial I have seen on the subject - thanks so much!

kclaiborn
Автор

The best Tutorial I have ever seen, good stuff!

edwinguo
Автор

Thank you very much Anthony, extremely useful and well done 100%

aqc