2FA, or two-factor authentication, is a way of confirming a user is logged in by using a second device to confirm their identity. In this video, learn how to implement a way to send a 2FA code to a person's mobile phone using Twilio.
- [Instructor] We're going to be using Twilio … to send a two-factor SMS code. … So we're going to to start by importing the trace function … from the random model so that we can generate the SMS code. … And we have to import the REST client for Twilio. … And we already have a model here. … So what we're going to do is create a class method … to send the code. … And we're passing in the class at the user … and the phone number that we're going to send the code to. … Before we do anything else, … we need the account SID and the auth token. … You can get the account SID and the auth token … and the phone number from the Twilio Dashboard. … You can sign up for a Twilio trial account … and create an SMS account. … You can paste in the account SID and auth token … and then we can create the Twilio Client … using the account SID and the auth token. … We're going to generate the code using these digits. … And we use choice to select random digit … for a six-digit code. … And we're going to be creating …
Skill Level Advanced
Building a Paid Membership Site with Djangowith Nick Walter1h 15m Intermediate
OWASP Top 10: #7 XSS and #8 Insecure Deserializationwith Caroline Wong26m 31s Intermediate
Building RESTful Web APIs with Djangowith Rudolf Olah1h 9m Intermediate
1. Permissions, Access Controls, Activity Logs
2. Throttling a Flood of Requests
3. Protecting Data and Data Privacy
4. 2FA: Two-Factor Authentication
5. CSRF: Cross-Site Request Forgery Protection
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.