Two-Factor Authentication (2FA) in Python
Вставка
- Опубліковано 31 лип 2024
- Today we learn how to generate and verify one-time passwords (OTP) for two-factor authentication (2FA) in Python.
◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾
📚 Programming Books & Merch 📚
🐍 The Python Bible Book: www.neuralnine.com/books/
💻 The Algorithm Bible Book: www.neuralnine.com/books/
👕 Programming Merch: www.neuralnine.com/shop
🌐 Social Media & Contact 🌐
📱 Website: www.neuralnine.com/
📷 Instagram: / neuralnine
🐦 Twitter: / neuralnine
🤵 LinkedIn: / neuralnine
📁 GitHub: github.com/NeuralNine
🎙 Discord: / discord
🎵 Outro Music From: www.bensound.com/
Timestamps:
(0:00) Intro
(0:18) Time-Based OTP
(6:25) Counter-Based OTP
(8:28) Google Authenticator QRCode
(11:46) Outro - Наука та технологія
Great video! Brief, informative, precise, and without BS. Keep up the fantastic work!
Excellent to the point video without wasting any time with nonsense. Learned exactly what I came here for, nothing more, nothing less. This is a perfect example of what all UA-cam tutorial videos should be.
Best channel for python developers ever, I learn a lot from you man!!
Awesome, man. As always very interesting content showing practical use of nice things.
Thank you 😊 This video came at just the right time for me. It will allow me to very easily add 2FA to an app that I'm currently developing.
This is awesome. This is similar to the project I am building in my current class. I added similar code to flask app along with html files to create webpages😊🎉
Thank you! So helpful and practical.
Awesome! Thank you for the great content.
Very useful demo. Thanks :)
Thank you for great tutorial!
Very useful. Thank you for the tutorial
Thank you for the video.
Great chanel !, awesome example, thank you
Great stuff
Beautiful man! Can you make a video and explain how to have a different code for each computer?
Great Great🔥🔥
this is very usefull, but I'm looking for kind of the oposite, like I want to make the authenticator itself, what I mean is, I want to make my own app where I can scan the qr code or something, and aply the uri there from any service, to keep them all in the same app, my own app.
and you probably will ask why, well i have a bunch of acounts and 3 Auth apps, and some accounts dont work with some Auth apps, you need a specific auth app for that type of account, so I wonder if is possible to make your own Auth app and have all the accounts on it???
hey brother can u plz. tell u r from which university and what are u learning like ur major and all.......
I want ask you question please
Can I send sms messages for my phone use python
Or use USB
Or use kivy
I mean same apk sms messages in phone📱
I get the following error:
TypeError: argument should be a bytes-like object or ASCII string, not 'list'
What do i do?😭
I create the uri and generate the QRCODE, when I scan using google authenticator it shows "key not recognized"
I am trying to do this in bit different way but I get non base32 detection error and I am not able to log in to my broker plz help
love!
when i generate qrcode and scan using google authenticator i received error "key not recognized"
gracias!
Great...
Great Video!
Is it advisable to have some sort of destruction mechanism on that QR Code?
Otherwise, anyone that scans it would be able to add it to an authenticator app?
Or does that QR Code already come with some sort of OTP encrypted?
Plz Share code
I want to inform other people, that the key needs to be more than 19 letters. You will get an error, if you the key has less than 20 letters.
Please make a video on python with keycloak it has all these features and 2fa and main thing is its open source
Hey what do i do when i try to scan the qr with google authenticator and it says that error: key not recognised?
any solutions/ideas?
pyotp.totp.TOTP(base64.b32encode(secret_key))
google authenticator needs converted base32 key
👌💖
How to increase time from 30 seconds to 3 minutes or more??
You can't increase the duration that a TOTP token is valid.
However you can add an extra argument in the verify function to increase the window of tokens that will be valid:
# accept the current, previous and next token (for most applications this should be sufficient):
pyotp.verify(otp=, valid_window=1)
# accept the current, previous 3 and next 3 tokens:
pyotp.verify(otp=, valid_window=3)
Hi ModuleNotFoundError: No module named 'pyotp'
Comment for engagement
the key has to be base64, not string
Was wondering about this, thank you
Happy I will not be writing the logic provided py PyOTP from scratch.
too much import you show nothing...
Nice ! Thanks! Great video!
Little question.. I'm trying to in my provisioning_uri to send an image.. (to be able to have it in the autentication app ..like microsoft, etc).. but so far without success ... i have not found any documentation related.. any ideas ?
uri = totp.provisioning_uri(name=user, issuer_name=company, image=url)
url = "XXXXX/myimage.png"
i dont receive any error.. but also no image in the app