Пікірлер
@AnuragHalderEcon
@AnuragHalderEcon 27 күн бұрын
This is very useful, thank you, can you please help in case I need to protect more than one page. Thanks in advance.
@okao08
@okao08 Ай бұрын
Thank you so much, I didn’t know how to load fonts earlier
@akshatadhadambe5812
@akshatadhadambe5812 3 ай бұрын
worked like a charm thankyou!!!
@AISolutionsPH
@AISolutionsPH 4 ай бұрын
what should be client_secrets_file value if im about to host the code in the cloud? seems to have an issue with errors not being able to find client_secret.json file
@user-ml3ku5km6r
@user-ml3ku5km6r 5 ай бұрын
HI. You said that in production we can not use the flask session, how can I do so? Thank u
@user-dk2tz1ww9x
@user-dk2tz1ww9x 6 ай бұрын
Hey great video! You said session shouldnt be used in production for storing secrets. So what to use instead?
@nimitmore5830
@nimitmore5830 8 ай бұрын
my github copilot knew this code already🙃 even more accurate, @code_specialist video was great & informative but try this 1. go slow (let us read) 2. show us imports dont just use IDE hacks to import 3. don't forget you are teaching/demonstrating so think viewers as newbies & let us listen thank you
@imvickykumar999
@imvickykumar999 9 ай бұрын
How to solve this error? google.auth.exceptions.InvalidValue: Token used too early, 1696952275 < 1696952283. Check that your computer's clock is set correctly.
@JSchwift
@JSchwift 6 ай бұрын
Having same issue
@NM_kawaii
@NM_kawaii 10 ай бұрын
thanks a lot man!! been trying to do it for 3 weeks now and finally it worked
@rodribara
@rodribara Жыл бұрын
That cleared up how to use it for useState for me. Thanks!
@mcnutley
@mcnutley Жыл бұрын
Hello, I keep getting this error using the GitHub Repo: from google.oauth2 import id_token ModuleNotFoundError: No module named 'google'
@maikelberbi5210
@maikelberbi5210 Жыл бұрын
Gracias, muy buena explicacion y muy facil
@sergioromero5146
@sergioromero5146 Жыл бұрын
te sirvió?
@snippletrap
@snippletrap Жыл бұрын
I get a key error from line 44 (using latest packages in March 2023). The session object does not persist from `login()` to `callback()`... if I print "'state' in session' as the first line of `callback()` the value is False.
@gorgolyt
@gorgolyt Жыл бұрын
7:42 Bug. ^ is not the power operator.
@virtualalphastudios6149
@virtualalphastudios6149 Жыл бұрын
You should be learning how to use Vite or NextJS in this day in age. Do not use npm create-react-app in 2023.
@code_specialist
@code_specialist Жыл бұрын
Indeed. I’d suggest learning NextJS to anyone. Love it
@leonelmira3124
@leonelmira3124 Жыл бұрын
Good job men, thanks for all the information! now you have a new sub, greetings from Colombia
@jens6005
@jens6005 Жыл бұрын
For anybody getting an error with request.session() >>> the solution is to: (1) pip install requests and (2) import requests and (3) make it: request_session = requests.Session() Took me ages to find out...
@nimitmore5830
@nimitmore5830 8 ай бұрын
took me minutes to this solution, Comment section == stackoverflow
@CalibanDev
@CalibanDev Жыл бұрын
Hi, i got: KeyError: 'state' on: if not session["state"] == request.args["state"]: What can i do?
@code_specialist
@code_specialist Жыл бұрын
Seems like the response didn’t contain a state. That’s most likely because your authorization url also had none
@soosbot2244
@soosbot2244 Жыл бұрын
Dam I think chatGPT based its answer on your code
@hearnercleadxi1365
@hearnercleadxi1365 Жыл бұрын
Nice project
@kobirsing9872
@kobirsing9872 Жыл бұрын
Awesome video! Ready to see the next!
@travellingmadness8910
@travellingmadness8910 Жыл бұрын
Thanks for sharing a nice video
@chaifps
@chaifps Жыл бұрын
HI I am getting this error, please help out ValueError: Token used too early, 1665681789 < 1665681803. Check that your computer's clock is set correctly.
@CalibanDev
@CalibanDev Жыл бұрын
Use the syncronize option that comes with the clock of windows.
@code_specialist
@code_specialist Жыл бұрын
Most likely a synchronization issue, yeah
@audywboonanake3125
@audywboonanake3125 Жыл бұрын
clock_skew_in_seconds = <int> id_info = id_token.verify_oauth2_token( id_token=credentials._id_token, request=token_request, audience=GOOGLE_CLIENT_ID, clock_skew_in_seconds=10 )
@imvickykumar999
@imvickykumar999 Жыл бұрын
I am getting this error Error 400: redirect_uri_mismatch You can't sign in to this app because it doesn't comply with Google's OAuth 2.0 policy. If you're the app developer, register the redirect URI in the Google Cloud Console.
@chaifps
@chaifps Жыл бұрын
click on error details, they will give you the new URI to add, go to credentials page, select your credential, scroll down and add the given URI to it.
@code_specialist
@code_specialist Жыл бұрын
Your redirect uri does not comply with the standard. Maybe your redirect uri points to something like 0.0.0.0… or 127.0.01? However it must be a hostname e. g localhost
@cookiemilk3347
@cookiemilk3347 Жыл бұрын
Hey I seem to be getting this very strange error when trying to login... it was working just fine before: Token used too early, 1663292036 < 1663292037. Check that your computer's clock is set correctly
@CalibanDev
@CalibanDev Жыл бұрын
Use the syncronize option that comes with the clock of windows.
@hickasso
@hickasso Жыл бұрын
Man, u need to show us what you are using as import. Like in the end, you have imported google package, cachecontrol and others, but was hard to understand this.
@nimitmore5830
@nimitmore5830 8 ай бұрын
True, i fed up with errors, then went straight to his github and copy pasted his code, it ran sucessful 1 time... :D 1 time :D
@grege6564
@grege6564 2 жыл бұрын
I know this is an older video, but everything worked smoothly in your code. However, I encounter a strange issue. I keep getting a Key Error 'state' from the line: if not session['state'] == request.args['state'] If i comment out that line, it works. I printed the state in both /login route and /callback route, and the state key is being read SOMETIMES. Sometimes, it just doesn't exist. Any ideas as to why sometimes the state key doesn't exist?
@marcinajman6256
@marcinajman6256 2 жыл бұрын
InvalidGrantError oauthlib.oauth2.rfc6749.errors.InvalidGrantError: (invalid_grant) Bad Request :////
@marcinajman6256
@marcinajman6256 2 жыл бұрын
if anyone face this problem: AttributeError: module 'google_auth_oauthlib.flow' has no attribute 'from_client_secrets_file' try: from google_auth_oauthlib.flow import Flow
@jaypatel-vy9qw
@jaypatel-vy9qw 2 жыл бұрын
Would you be open to join a zoom session so I can learn how to implement this into my code?
@udaydeepyadav
@udaydeepyadav 2 жыл бұрын
Hi , your way of explaining is very and simple, i learnt a lot from this video, i had dew doubts on this concept but thanks to you, also i have a strong suggestion, n your video you are almost whispering, which took all my nerve to understand even after putting on the headphones, dont take me wrong, but its a strong suggestion for you.
@Dr.Cosmar
@Dr.Cosmar 2 жыл бұрын
Yep, that's 1.5 hours I'll never get back. You blasted through the last 3 mins (really should have been stretched to 10) making my efforts in following along less than worthless...
@Dr.Cosmar
@Dr.Cosmar 2 жыл бұрын
Yeah, that's shit bud. 1.) Stop mumbling....open your f***ing mouth when you speak. 2.) Slow TF down...specially near the end, like....Whyyyy???? 3.) Syntax is important, most people are touching these modules for the first time....give us 6 seconds per line to absorb what's going on at least. While videos can be paused, this was incredibly painful. Considering you went through 50 lines of code in 8 mins before finally testing it. For people even intermediate trying to learn off this is rough. Regardless, thank you. I would be a right dixk head if I didn't give an honest opinion.
@nimitmore5830
@nimitmore5830 8 ай бұрын
"Agreed"
@tomasdavid1643
@tomasdavid1643 2 жыл бұрын
Hi and big thanks for this straightforward tutorial! Can you give me a hint how to proceed if I want to create a user restricted areas with data from their APIs (i.e. Google Analytics) please?
@mattbrown4275
@mattbrown4275 2 жыл бұрын
I don't think you can use the @login_is_required on multiple routes or it will throw an AssertionError? but something like, should stop it asserting.. wrapper.__name__ = function.__name__ return wrapper
@RomeshEtulgama
@RomeshEtulgama 2 жыл бұрын
Thank you!
@RacsoNagem
@RacsoNagem Жыл бұрын
Amazing!
@nemanjatrivic9505
@nemanjatrivic9505 5 ай бұрын
better solution is wraps because it mimics the function completely including docstrings. @functools.wraps(function) def wrapper(*args, **kwargs):
@okopyl
@okopyl 2 жыл бұрын
Yo. You made a mistake in your video. instead of request_session = request.session() you should have request_session = requests.session() as in your code on GitHiub.
@boldganbaatar7023
@boldganbaatar7023 2 жыл бұрын
True
@okopyl
@okopyl 2 жыл бұрын
"Flask comes with a session package... you shouldn't use it in production..." Could you please tell what and how should I use in production?
@code_specialist
@code_specialist 2 жыл бұрын
Check out this post: blog.miguelgrinberg.com/post/how-secure-is-the-flask-user-session . There are several solutions to this, such as flask-session, that rather saves data server than client sided e. G: pypi.org/project/Flask-Session/
@okopyl
@okopyl 2 жыл бұрын
@@code_specialist thanks
@paggiechen8866
@paggiechen8866 2 жыл бұрын
love your voice(though this is not the point lol
@yuvrajsurve3825
@yuvrajsurve3825 2 жыл бұрын
Hi, I am trying login through google sign-in on my mobile phone(which is connected to my local area network ), I am getting redirected to the Google sign-in page but after that, it just keeps loading but on my system (on which website is hosted)I am not facing any issue everything is working fine. can you please help me .
@yumindev
@yumindev 2 жыл бұрын
sir, in the callback function, is it "request_session = requests.session() " or "request_session = request.session()" ? Your code and your video show different.
@mrhamfi9489
@mrhamfi9489 2 жыл бұрын
return [*map(lambda x:x*x,range(1,500))] type , was a slick trick , thanks 👍😊
@aeeee7562
@aeeee7562 2 жыл бұрын
Authentication/Authorizationt, tia
@reuhakz9540
@reuhakz9540 2 жыл бұрын
thanks alot bro.. very usefull..
@christophechouinard7619
@christophechouinard7619 2 жыл бұрын
Well. This is rough hahaa
@abhijeetsinha9333
@abhijeetsinha9333 2 жыл бұрын
Amazing explanation, loved it!!
@adarshamin3942
@adarshamin3942 2 жыл бұрын
Hello, thank you for your helpful tutorials. I am working on a group project creating a flask app. I used your walkthrough for setting up an unsecure login which is perfect for our needs and works. We would like to be able to GET the users email from the google login. I am finding a lot of conflicting information and no luck yet. Would you know how to do this with the setup you utilized, I can also share our repo if that would help Greatly Appreciate Your Time! I sent an email if that is easier as well!
@code_specialist
@code_specialist 2 жыл бұрын
In the step of the callback we create an object „id_info“ that contains user information provided by Google by default. It also contains an „email“ field. There should also be something like an „email_verified“ field. However, that requires the scope to be „profile“ and „email“ at least. Our example already set those scopes. Check developers.google.com/identity/sign-in/web/backend-auth for more information
@code_specialist
@code_specialist 2 жыл бұрын
There are several potential topics to enhance this app in our next coding session on 27th of November: - Authentication/Authorization (OAuth2) - State Management (Redux) - CI/CD and Deployment (Docker + GitHub Actions) Just comment whatever you want to see next. If you got any further ideas you want to see on this, they’re also very welcome ✌️
@fahadmalik2914
@fahadmalik2914 2 жыл бұрын
Up ittyhhjióp
@babaimran1449
@babaimran1449 2 жыл бұрын
P
@Swingman23
@Swingman23 2 ай бұрын
I’m super late but any chance you could do a 3rd video on ci/cd and deployment? That’d be amazing!
@code_specialist
@code_specialist 2 ай бұрын
@@Swingman23 Unfortunately the feedback and the number of views was underwhelming for this series, which is why we stopped this after the second video. What would you expect of a video covering CI/CD and deployment? Maybe we can create a short one for your specifics.
@danomics7674
@danomics7674 2 жыл бұрын
You mentioned that the Flask "session" should not be used in production. What is a better method for doing this in production that you could recommend?
@code_specialist
@code_specialist 2 жыл бұрын
Miguel Grinberg whom we can recommend without reservation got an interesting article on the flask session: blog.miguelgrinberg.com/post/how-secure-is-the-flask-user-session . TLDR; the flask sessions are stored client side and not encrypted (basically they are just cookies). A valid alternative is the flask session library, which saves sessions server-side: pypi.org/project/Flask-Session/ . But there are also countless other solutions we didn't test personally. However, storing mere access tokens client side is common practice and is a valid production ready solution. The traditional flask session just isn't the right fit for any kind of sensitive data
@davidkurniasaputra228
@davidkurniasaputra228 2 жыл бұрын
Ha
@code_specialist
@code_specialist 2 жыл бұрын
Hu
@ppariventhan6647
@ppariventhan6647 2 жыл бұрын
Thanks for the descriptive step by step video.Following these steps i could use google authentication to login into my application successfully.But even after logout from my application the google authentication is kept alive and leads to login to the application without authentication again.How to close the google authentication session?
@code_specialist
@code_specialist 2 жыл бұрын
That’s most likely due to cookies that save the state of your Google auth requests. To clear the sessions you have to delete the cookies related to your Google login. Most browsers offer an overview of cookies in their developer console. By default the shortcut is F12 in Firefox and Chrome.
@code_specialist
@code_specialist 2 жыл бұрын
Check out policies.google.com/technologies/cookies#types-of-cookies for more information on the topic
@ppariventhan6647
@ppariventhan6647 2 жыл бұрын
@@code_specialist Thank you for the immediate response.How to delete the google login cookies programmatically?
@code_specialist
@code_specialist 2 жыл бұрын
Flask offers a delete_cookie method on the response object. However, you may encounter difficulties as the cookie at hand isn’t yours. It’s also bad practice to touch cookies that ain’t yours.