Adding Two Factor Authentication to your App with Authy
-
Upload
nick-malcolm -
Category
Software
-
view
313 -
download
2
Transcript of Adding Two Factor Authentication to your App with Authy
![Page 1: Adding Two Factor Authentication to your App with Authy](https://reader034.fdocuments.us/reader034/viewer/2022042723/588624321a28ab8f2c8b5ad1/html5/thumbnails/1.jpg)
Adding 2FA to your App with Authy (but actually 2SV)
Nick [email protected]/nickmalcolm/twofactorexample
![Page 2: Adding Two Factor Authentication to your App with Authy](https://reader034.fdocuments.us/reader034/viewer/2022042723/588624321a28ab8f2c8b5ad1/html5/thumbnails/2.jpg)
The Difference Between Steps & Factors
Implementing Two-Step Verification with Authy
![Page 3: Adding Two Factor Authentication to your App with Authy](https://reader034.fdocuments.us/reader034/viewer/2022042723/588624321a28ab8f2c8b5ad1/html5/thumbnails/3.jpg)
What is 2FA?!
![Page 4: Adding Two Factor Authentication to your App with Authy](https://reader034.fdocuments.us/reader034/viewer/2022042723/588624321a28ab8f2c8b5ad1/html5/thumbnails/4.jpg)
Two Factor Authentication
![Page 5: Adding Two Factor Authentication to your App with Authy](https://reader034.fdocuments.us/reader034/viewer/2022042723/588624321a28ab8f2c8b5ad1/html5/thumbnails/5.jpg)
Step
One act of providing authentication
Factor
An independent source of
authentication
![Page 6: Adding Two Factor Authentication to your App with Authy](https://reader034.fdocuments.us/reader034/viewer/2022042723/588624321a28ab8f2c8b5ad1/html5/thumbnails/6.jpg)
Something You KnowSomething You HaveSomething You Are
![Page 7: Adding Two Factor Authentication to your App with Authy](https://reader034.fdocuments.us/reader034/viewer/2022042723/588624321a28ab8f2c8b5ad1/html5/thumbnails/7.jpg)
SMS:something you have???
Authy / GA:something you have???
![Page 8: Adding Two Factor Authentication to your App with Authy](https://reader034.fdocuments.us/reader034/viewer/2022042723/588624321a28ab8f2c8b5ad1/html5/thumbnails/8.jpg)
SMS:can be spoofed, cloned, MITMd, iMessage
Authy / GA:is based on the app knowing a user token
![Page 9: Adding Two Factor Authentication to your App with Authy](https://reader034.fdocuments.us/reader034/viewer/2022042723/588624321a28ab8f2c8b5ad1/html5/thumbnails/9.jpg)
Dongle thingies
Independent. Possession required.
![Page 10: Adding Two Factor Authentication to your App with Authy](https://reader034.fdocuments.us/reader034/viewer/2022042723/588624321a28ab8f2c8b5ad1/html5/thumbnails/10.jpg)
Two Step Two FactorSingle Factor
Password Password+ One Time
Password
Password+ OTP from an
INDEPENDENT component
![Page 11: Adding Two Factor Authentication to your App with Authy](https://reader034.fdocuments.us/reader034/viewer/2022042723/588624321a28ab8f2c8b5ad1/html5/thumbnails/11.jpg)
Example video time!
![Page 12: Adding Two Factor Authentication to your App with Authy](https://reader034.fdocuments.us/reader034/viewer/2022042723/588624321a28ab8f2c8b5ad1/html5/thumbnails/12.jpg)
Two Step Two FactorSingle Factor
Password Password+ One Time
Password
Password+ OTP from an
INDEPENDENT device
![Page 13: Adding Two Factor Authentication to your App with Authy](https://reader034.fdocuments.us/reader034/viewer/2022042723/588624321a28ab8f2c8b5ad1/html5/thumbnails/13.jpg)
What Do Customers Get Out Of It?
![Page 14: Adding Two Factor Authentication to your App with Authy](https://reader034.fdocuments.us/reader034/viewer/2022042723/588624321a28ab8f2c8b5ad1/html5/thumbnails/14.jpg)
What Do I Get Out Of It?
![Page 15: Adding Two Factor Authentication to your App with Authy](https://reader034.fdocuments.us/reader034/viewer/2022042723/588624321a28ab8f2c8b5ad1/html5/thumbnails/15.jpg)
Why use Authy?
![Page 16: Adding Two Factor Authentication to your App with Authy](https://reader034.fdocuments.us/reader034/viewer/2022042723/588624321a28ab8f2c8b5ad1/html5/thumbnails/16.jpg)
Let’s build it!
![Page 17: Adding Two Factor Authentication to your App with Authy](https://reader034.fdocuments.us/reader034/viewer/2022042723/588624321a28ab8f2c8b5ad1/html5/thumbnails/17.jpg)
Follow along:
● github.com/nickmalcolm/twofactorexample● (tag v0.1.0 will get you to a starting point)
![Page 18: Adding Two Factor Authentication to your App with Authy](https://reader034.fdocuments.us/reader034/viewer/2022042723/588624321a28ab8f2c8b5ad1/html5/thumbnails/18.jpg)
![Page 19: Adding Two Factor Authentication to your App with Authy](https://reader034.fdocuments.us/reader034/viewer/2022042723/588624321a28ab8f2c8b5ad1/html5/thumbnails/19.jpg)
Plan of attack:
1. Install Authy2. Let Users turn 2FA on3. Force 2FAd Users to verify on sign in
![Page 20: Adding Two Factor Authentication to your App with Authy](https://reader034.fdocuments.us/reader034/viewer/2022042723/588624321a28ab8f2c8b5ad1/html5/thumbnails/20.jpg)
1) Sign up & install Authy
![Page 21: Adding Two Factor Authentication to your App with Authy](https://reader034.fdocuments.us/reader034/viewer/2022042723/588624321a28ab8f2c8b5ad1/html5/thumbnails/21.jpg)
![Page 22: Adding Two Factor Authentication to your App with Authy](https://reader034.fdocuments.us/reader034/viewer/2022042723/588624321a28ab8f2c8b5ad1/html5/thumbnails/22.jpg)
/config/secrets.yml
/config/initializers/authy.rb
![Page 23: Adding Two Factor Authentication to your App with Authy](https://reader034.fdocuments.us/reader034/viewer/2022042723/588624321a28ab8f2c8b5ad1/html5/thumbnails/23.jpg)
2) Let users turn on 2FA
![Page 24: Adding Two Factor Authentication to your App with Authy](https://reader034.fdocuments.us/reader034/viewer/2022042723/588624321a28ab8f2c8b5ad1/html5/thumbnails/24.jpg)
Cellphone + Email
Token
Token
1) User Found/Created in Authy
2) Authy sends a token
3) The user sends it back
4) Success!
![Page 25: Adding Two Factor Authentication to your App with Authy](https://reader034.fdocuments.us/reader034/viewer/2022042723/588624321a28ab8f2c8b5ad1/html5/thumbnails/25.jpg)
/app/controllers/two_factor_authentication_controller.rb
![Page 26: Adding Two Factor Authentication to your App with Authy](https://reader034.fdocuments.us/reader034/viewer/2022042723/588624321a28ab8f2c8b5ad1/html5/thumbnails/26.jpg)
/app/views/two_factor_authenticator/setup.html.erb
![Page 27: Adding Two Factor Authentication to your App with Authy](https://reader034.fdocuments.us/reader034/viewer/2022042723/588624321a28ab8f2c8b5ad1/html5/thumbnails/27.jpg)
localhost:3000/two_factor_authentication/setup
![Page 28: Adding Two Factor Authentication to your App with Authy](https://reader034.fdocuments.us/reader034/viewer/2022042723/588624321a28ab8f2c8b5ad1/html5/thumbnails/28.jpg)
/app/controllers/two_factor_authentication_controller.rb
![Page 29: Adding Two Factor Authentication to your App with Authy](https://reader034.fdocuments.us/reader034/viewer/2022042723/588624321a28ab8f2c8b5ad1/html5/thumbnails/29.jpg)
/app/views/two_factor_authenticator/verify.html.erb
![Page 30: Adding Two Factor Authentication to your App with Authy](https://reader034.fdocuments.us/reader034/viewer/2022042723/588624321a28ab8f2c8b5ad1/html5/thumbnails/30.jpg)
localhost:3000/two_factor_authentication/verify
![Page 31: Adding Two Factor Authentication to your App with Authy](https://reader034.fdocuments.us/reader034/viewer/2022042723/588624321a28ab8f2c8b5ad1/html5/thumbnails/31.jpg)
![Page 32: Adding Two Factor Authentication to your App with Authy](https://reader034.fdocuments.us/reader034/viewer/2022042723/588624321a28ab8f2c8b5ad1/html5/thumbnails/32.jpg)
/app/controllers/two_factor_authentication_controller.rb
![Page 33: Adding Two Factor Authentication to your App with Authy](https://reader034.fdocuments.us/reader034/viewer/2022042723/588624321a28ab8f2c8b5ad1/html5/thumbnails/33.jpg)
Yay, 2FA is turned on!
![Page 34: Adding Two Factor Authentication to your App with Authy](https://reader034.fdocuments.us/reader034/viewer/2022042723/588624321a28ab8f2c8b5ad1/html5/thumbnails/34.jpg)
3) Use it when they sign in
![Page 35: Adding Two Factor Authentication to your App with Authy](https://reader034.fdocuments.us/reader034/viewer/2022042723/588624321a28ab8f2c8b5ad1/html5/thumbnails/35.jpg)
/app/controllers/sessions_controller.rb
![Page 36: Adding Two Factor Authentication to your App with Authy](https://reader034.fdocuments.us/reader034/viewer/2022042723/588624321a28ab8f2c8b5ad1/html5/thumbnails/36.jpg)
/app/controllers/sessions_controller.rb
![Page 37: Adding Two Factor Authentication to your App with Authy](https://reader034.fdocuments.us/reader034/viewer/2022042723/588624321a28ab8f2c8b5ad1/html5/thumbnails/37.jpg)
localhost:3000/sessions/two_factor_required
![Page 38: Adding Two Factor Authentication to your App with Authy](https://reader034.fdocuments.us/reader034/viewer/2022042723/588624321a28ab8f2c8b5ad1/html5/thumbnails/38.jpg)
/app/controllers/sessions_controller.rb
![Page 39: Adding Two Factor Authentication to your App with Authy](https://reader034.fdocuments.us/reader034/viewer/2022042723/588624321a28ab8f2c8b5ad1/html5/thumbnails/39.jpg)
![Page 40: Adding Two Factor Authentication to your App with Authy](https://reader034.fdocuments.us/reader034/viewer/2022042723/588624321a28ab8f2c8b5ad1/html5/thumbnails/40.jpg)
What did we do?
● Learnt the difference between Steps & Factors
● Signed up for Authy● Let users turn on 2FA● Required a 2FA token on Sign In
![Page 41: Adding Two Factor Authentication to your App with Authy](https://reader034.fdocuments.us/reader034/viewer/2022042723/588624321a28ab8f2c8b5ad1/html5/thumbnails/41.jpg)
Thanks! Questions??github.com/nickmalcolm/twofactorexample
@nickmalcolmrevert.io