Join my free course on the basics of Flask-SQLAlchemy: prettyprinted.com/flasksql
@yusufsalk1136 Жыл бұрын
This is by far the most underrated jsonify pronunciation. Great video by the way. Thanks.
@pratikrane1495 жыл бұрын
Neat explanation. Everything straight to the point. Thanks a ton for sharing such quality tutorials! This helped me a lot in understanding jwt
@prettyprinted5 жыл бұрын
I'm glad I could help.
@marcoio87423 жыл бұрын
Terrific! This is super useful. 3 years later, thank you
@noletovictor4 жыл бұрын
Perfect! That is exactly what I need! Thank you for this simple, fast and easy solution!
@prettyprinted4 жыл бұрын
Glad it helped!
@笨土豆3 жыл бұрын
Thx for this video, i have learned several JWT video tutorial on youtube. Your video is most clear i ever seen these days. Very helpful thx
@AnikSardar3 жыл бұрын
Best video on authentication. Extremely well explained.
@WilliamRosswpr1017 жыл бұрын
Thanks for sharing this. It has been a huge help towards understanding JWT in Python
@prettyprinted7 жыл бұрын
You're welcome! Thanks for watching.
@koodauskanava90967 жыл бұрын
Always use 401 for unauthenticated routes. 403 is forbidden logic, for example forbidden directory listing etc. Not related to authentication.
@prettyprinted7 жыл бұрын
Thanks! I should have looked those up before recording the video. I always get them confused.
@mbonuchinedu24204 жыл бұрын
ANOTHER LIFE SAVER...... More blessing to you..................
@prettyprinted7 жыл бұрын
Thanks for watching! Join the hundreds of others who have taken my Flask courses on prettyprinted.com
@stanleyjohn46705 жыл бұрын
Can you show how to use JWT in Django? It's a sincere request, thank you.
@TeddyAndersson957 жыл бұрын
So excited, to watch this! I also 100% sure you will deliver another awesome tutorial :D
@prettyprinted7 жыл бұрын
I try my best!
@JulienPy7 жыл бұрын
Still your great and step-by-step approach style. Very appreciated!
@prettyprinted7 жыл бұрын
I'm glad you enjoyed it!
@BRBallin15 жыл бұрын
Great introduction. Made a somewhat intimidating topic seem straightforward
@prettyprinted5 жыл бұрын
Glad the video helped! Thanks for watching.
@koodauskanava90967 жыл бұрын
Very good tutorial. Useful stuff!
@Leo-fh7fu4 жыл бұрын
another beautiful video, thanks for sharing my friend, subscribed!!
@ThaEzioAuditore7 жыл бұрын
Thank you thank you thank you a million times ! your efforts are very much appreciated
@prettyprinted7 жыл бұрын
You're welcome! And I appreciate you for taking the time to watch.
@techsteering3 жыл бұрын
Thanks a lot! This is exactly what I was looking for. You saved me tons of time. Thanks again. :)
@vic_shine7 жыл бұрын
Many thanks, Anthony! Brain storage was improved :)
@prettyprinted7 жыл бұрын
You're welcome! Thanks for watching.
@v4ldevrr4m472 жыл бұрын
The best simple example. thanks
@rakeshingle4 жыл бұрын
Thank you, This helped me a lot.
@andrewbartlett20915 жыл бұрын
Really clear, very informative, thanks a lot
@prettyprinted5 жыл бұрын
You're welcome! Thanks for watching.
@somed_92165 ай бұрын
It was really helpful, thank you
@orlapa3 жыл бұрын
Excelente tutorial, this is useful for someone starting with this. Thanks
@saguoran5 жыл бұрын
2019, I found this video is useful. good contents.
@prettyprinted5 жыл бұрын
I'm glad you like. Thanks for watching!
@mellimelloweb4 жыл бұрын
Thanks Anthony for your excellent work. Can you complete this video with the implementation of refresh token? That would be very great!
@СергейНаталенко-х2х3 жыл бұрын
Огромное спасибо Ваше видео очень помогло мне в работе) Thank you very much!!!
@shreevidyas.r82752 жыл бұрын
Thankyou for this wonderful video... Now am able to know how to create token and storing them...Can you please provide the video on requesting using that token from that moment on.
@carloseduardodasilvaolivei89393 жыл бұрын
Thank you very much this video helped me a lot
@zzakpk4 жыл бұрын
very helpful tutorial. Thank you.
@ikhsanrahman97035 жыл бұрын
cool, how about for refresh token. that happen when we try to keep user remain login inside
@christianduahmarfo5283 Жыл бұрын
How was the `prompt screen` possible? Did you use HTML for the Login form?
@Tbalbiza_POV Жыл бұрын
Thank you, very helpful !!!!!!!!!!!!!!!!!
@prettyprinted Жыл бұрын
You're welcome! Thanks for watching.
@charlieontheearth7 жыл бұрын
Thanks for this video. It's very helpful for me.
@prettyprinted7 жыл бұрын
You're welcome! Thanks for watching.
@XBoysGaming226 жыл бұрын
This is nice! Great video!
@prettyprinted6 жыл бұрын
Thanks for watching!
@dhyanprasad5611 Жыл бұрын
nice video. wanted to add that when i tried to authenticate the token using a header, I got back invalid token because I didnt specify the decode algorithm
Hi, very helpful video. Please can you put the link to the video that follows this one in this flask api cours ?
@nicolascorrea19894 жыл бұрын
you're the best !
@abhaychinchole34823 жыл бұрын
i am getting invalid token despite of copying the token...help will be appreciated
@selman8653 Жыл бұрын
Thanks mate
@eriklee11315 жыл бұрын
Great video!
@prettyprinted5 жыл бұрын
Thanks for watching!
@Maslacak19852 жыл бұрын
any guess with : RuntimeError: Working outside of request context. This typically means that you attempted to use functionality that needed an active HTTP request. Consult the documentation on testing for information about how to avoid this problem.
@paballo694 Жыл бұрын
Did you manage to solve this?
@sosajacobb7973 Жыл бұрын
when returning decorated make sure its return decorated, not return decorated()
@raghu112204 жыл бұрын
Nice man.. your doing great job.. its possible to make video on Keycloak with flask or django.. looking forward to hear from you
@ayyapanr5 жыл бұрын
Great Tutorial! Works on the browser and postman.. but when I try Python3 requests, I get 401 back.. wireshark captures look similar.. anyways do we need to consider some encoding when we use Python3 clients?
@prettyprinted5 жыл бұрын
You may have to. I'll have to test this out with calling from Python.
@danielfernandomurciaperdom76654 жыл бұрын
thank you so much
@robertwoodard84623 жыл бұрын
The jwt decode always throws an exception to token is invalid. It's passing the correct token, checked with a print, but it doesn't seem to like it. *UPDATE* you now have to pass the algorithm to decode the jwt token with as a list
@robertkl52612 жыл бұрын
thank you very much, had the same error and your comment saved me a lot of time :)
@animeshmisra5387 Жыл бұрын
Thanks! man
@satriyaningjagat Жыл бұрын
data = jwt.decode(token, app.config['SECRET_KEY'], algorithms= ['HS512', 'HS256'])
@TusharBhut-mk6mn Жыл бұрын
Can you make video on individual authentication for user and admin, where user authorized can use only [GET] method, while admin authorized can use [crud] methods.
@fly50789 Жыл бұрын
I am not sure about what is the different about flask-jwt-extend and flask-login? Which is better?
@petrk.49014 жыл бұрын
Hello, I would like to thank you for the videos you make are very beneficial for me. I wanted to ask you if you could create user roles using token_required. In this video, you used the feature only to reveal content for the logged-in user. Couldn't the functionality be extended to user roles? For example, Admin would have read, write, user read only, or other read only for some content. I want to create user roles. Thank you
@SanuKumar_addicted_brat3 жыл бұрын
Thanks for sharing such a great video, can you also help me with the logout?
@hsz73385 жыл бұрын
Thank you for putting amazing tutorials together. I was wondering if you could make a video on Flask or Flask_restplus uses Oauth2? Thank you.
@prettyprinted5 жыл бұрын
I'll consider that. Thanks for the idea and for watching.
@rienadetrof61985 жыл бұрын
Hello , how do you get the pop up to sign in? Great video btw!
@LatinDanceVideos4 жыл бұрын
this is the section of code that generates the pop box to sign in. maybe try using chrome incognito window. as the standard chrome caching introduces confounding behaviour. def login(): print("def login()") auth = request.authorization print("auth:", auth)
@mrsterbenblack92705 жыл бұрын
Very nice.
@prettyprinted5 жыл бұрын
Thanks for watching!
@hrishinani2 жыл бұрын
Hi very clean explanation of the code but I'm unable to get output due to this line try: data = jwt.decode(token, app.config['SECRET_KEY']) any resolution for this please...
@jacksonjegatheesan50454 жыл бұрын
hi nice tutorial by the way how would i log out and how can i send login credentials from my front end
@KotoFF4ik3 жыл бұрын
Awesome
@Kinyanjui_7652 жыл бұрын
hey if you see this...can make a video about how you can link this up with vanilla javascript? thank you
@madhavparikh96534 жыл бұрын
Really liked the explanation !!!. Still, it directly not verified and does not display any prompt to enter username and password. Anyone know why?
@KillerCookie4 жыл бұрын
Thanks for a great tutorial! However, the link to the code seems to be broken, might want to fix it.
@Brunovtf3 жыл бұрын
Can you add LOGOUT route? For cleaning the Token
@anusham45595 жыл бұрын
I am new to python and its Very helpful. Can you let me know how to pass a parameter to 'protected' function along with token?
@prettyprinted5 жыл бұрын
Could you be more specific? What are you trying to accomplish?
@anusham45595 жыл бұрын
never mind. I got it working. I actually had an input parameter to the function and passing token along with input parameter was not working. But the issue was I was not calling it properly. Its working now. Thanks!
@twishasahay31782 жыл бұрын
Hi i dont know why but the auth =request.authorization is not working for me. I am not getting the notification to fill in the username/password. I am getting the could not verify response. do i have to install any library other than the ones mentioned in the video or change any settings
@danieldaschle7 жыл бұрын
THANKS
@prettyprinted7 жыл бұрын
You're welcome! Thanks for watching.
@ambeshsingh12516 жыл бұрын
very nice video. After hiting the login url for the first time it asks for username and password but after that it does not ask for it and directly gives the token. can u help me how it should ask for user-id and password everytime login API is hit..
@FlexThoseMuscles6 жыл бұрын
I encountered problems while running, it always says no module name jwt so I did steps below: make sure to upgrade flask to the last version with : pip3 install flask uninstall jwt with: pip3 uninstall jwt install pyjwt with: pip3 install pyjwt
@FlexThoseMuscles6 жыл бұрын
thanks for the like! Our teacher is sending his students on your tutorial (see: jberger.org/ on the twitter feed). Best luck with the premium courses and the tutoring.
@Ekosusiloharjo5 жыл бұрын
Hi Anthony Get the code here not found
@kingleo1883 жыл бұрын
Thank you very much for the great video, Very well explained. Although I have stumbled at 17:49, Even though I have added the token in the URL, I got a "token is invalid" json response, Please help, I have gone through and copied your code as it is, But not sure where I went wrong.
@gustavocarnaval66223 жыл бұрын
Try to specify the algorithm on the decode function of JWT.
@selimduvakl68072 жыл бұрын
ı have the same problem. Did you be able to solve it?
@ComputerScience1015 жыл бұрын
Hi , I have created database using sqlite, how do i access the data here for credentials
@rizwanrizwan41765 жыл бұрын
how can i validate the different type of user like admin can view everything but user must restricted to see something? and also how to write security code for form data ?
@asgaraliyev87404 жыл бұрын
is that request being restful request by the secret key now?
@fogcc1015 Жыл бұрын
but how automatically pass this token in all request ? Is that THE question !!!
@kmishy2 жыл бұрын
Great explanation sir but title is misguiding because you have not used any API
@castro_hassler4 жыл бұрын
What is the difference between doing this, and using the flask session object?
@castro_hassler4 жыл бұрын
Just in the first case the clients does manage the request token to access the server, and in the other case the server allows a client based on a Cookie session, which one is better? Scalability seems to be in troubles when the server is the one who manage the permissions 'cause it has to maintain a state, but when is it a good idea to use, I mean the flask session object ¿
@____R__5 жыл бұрын
After hitting login api for first time it asks for username and password. But after that it does not ask and direct given new token . Can u help me how it should ask userid and password every time login api is hit.
@animeshmishra42823 жыл бұрын
If i am making a website that uses this api but i want users to surf the website but not that api then what should i do ? 😩
@MegaFeel14 жыл бұрын
Hey bro! But where is the code from this video? "Get the code here" page give me 404 error
@Coristo054 жыл бұрын
Hi, i've got problem with request.authentication cause it's NoneType object. How should I fix it?
@corollayanki3 жыл бұрын
it's request.authorization, but you probably figured that out by now.
@surajthapa56882 жыл бұрын
Can anyone provide a link for a next video please?
@lovneetchugh80633 жыл бұрын
I am getting this error return jsonify({'token' : token.decode('UTF-8')}) AttributeError: 'str' object has no attribute 'decode'
@FailedSquare2 жыл бұрын
Read the error message. Its telling you token is already a string type. In his example, on an older version of jwt it returned a byte type. Which is why the decode was needed for his example. return jsonify({'token': token})
@anishupadhyay8982 жыл бұрын
hi when with the valid token obtained from login page still I get the message as token is missing.. can someone please help me with this
@naveengoyal52436 жыл бұрын
Can you please help me, that how should I go to the protected view without copy pasting the token manually and only using the python code.
@prettyprinted6 жыл бұрын
You can use the library requests and authenticate that way.
@aloysiusseow97743 жыл бұрын
request.authorization does not show a pop up authentication on my web browser pls help!
@shivanshjayara63722 жыл бұрын
why pop up window for login is not opening. Can any one please tell me that. Any html template needed for that?
@asimhafeezz4 жыл бұрын
is it flask-jwt installed?? becuz it says no library exists when i try to install jwt...
@corollayanki3 жыл бұрын
the package is called pyjwt, so you do: pip install pyjwt
@moiarmio48634 жыл бұрын
how to use it own my website rather than local host ?
@mahdihoseyni36612 жыл бұрын
how can get refresh token in this case?
@milindchavan43293 жыл бұрын
this video belongs to which play list ? coz i want cover the whole topic ? plz suggest #PrettyPrinted
@sunilsolanki50432 жыл бұрын
how to pass token directly to another api?
@biunircloud64324 жыл бұрын
Someone could share link the next video? Thanks
@sunilsolanki50432 жыл бұрын
where the data variable is used?
@priteshthaker83404 жыл бұрын
Get the code link doesn't work
@georgegoldmanonyedikachijo93303 жыл бұрын
while trying to implement this i got TypeError: 'module' object is not callable Traceback (most recent call last) File "/home/lb/Documents/trie/venv/lib/python3.8/site-packages/flask/app.py", line 2464, in __call__ return self.wsgi_app(environ, start_response) File "/home/lb/Documents/trie/venv/lib/python3.8/site-packages/flask/app.py", line 2450, in wsgi_app response = self.handle_exception(e) File "/home/lb/Documents/trie/venv/lib/python3.8/site-packages/flask/app.py", line 1867, in handle_exception reraise(exc_type, exc_value, tb) File "/home/lb/Documents/trie/venv/lib/python3.8/site-packages/flask/_compat.py", line 39, in reraise raise value File "/home/lb/Documents/trie/venv/lib/python3.8/site-packages/flask/app.py", line 2447, in wsgi_app response = self.full_dispatch_request() File "/home/lb/Documents/trie/venv/lib/python3.8/site-packages/flask/app.py", line 1952, in full_dispatch_request rv = self.handle_user_exception(e) File "/home/lb/Documents/trie/venv/lib/python3.8/site-packages/flask/app.py", line 1821, in handle_user_exception reraise(exc_type, exc_value, tb) File "/home/lb/Documents/trie/venv/lib/python3.8/site-packages/flask/_compat.py", line 39, in reraise raise value File "/home/lb/Documents/trie/venv/lib/python3.8/site-packages/flask/app.py", line 1950, in full_dispatch_request rv = self.dispatch_request() File "/home/lb/Documents/trie/venv/lib/python3.8/site-packages/flask/app.py", line 1936, in dispatch_request return self.view_functions[rule.endpoint](**req.view_args) File "/home/lb/Documents/trie/application/admin/routes/auth.py", line 20, in unprotected token = jwt({'user': auth.username, 'exp': datetime.datetime.utcnow() + datetime.timedelta(minutes=30)}, app.secret_key) TypeError: 'module' object is not callable
@artisole33043 жыл бұрын
same bro same error
@SwapnilSudhir476 жыл бұрын
Hi , I am trying to login in the first login function, but it is again showing the login popup, even after credentials. Please help
@prettyprinted6 жыл бұрын
Even if you use the code I've linked to in the description?
@SwapnilSudhir476 жыл бұрын
Its done...found a different approach.
@ayah58965 жыл бұрын
@@SwapnilSudhir47 I have got the same issue. Can you please tell me how did you solve it? Thanks
@SwapnilSudhir475 жыл бұрын
@@ayah5896 I might have forgotten what i was doing, but can you please check in the console network, what issue is there, I can help :-)
@uripeled24 жыл бұрын
How the the token is saved?
@TheNorthRemember6 жыл бұрын
Great tutorial, can you please give me the syntax theme
@prettyprinted6 жыл бұрын
Thanks. I just use the default one in Sublime Text 3.