adding two factor authentication to your app with authy

41
Adding 2FA to your App with Authy (but actually 2SV) Nick Malcolm @nickmalcolm github.com/nickmalcolm/twofactorexample

Upload: nick-malcolm

Post on 14-Apr-2017

313 views

Category:

Software


2 download

TRANSCRIPT

Page 1: Adding Two Factor Authentication to your App with Authy

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

The Difference Between Steps & Factors

Implementing Two-Step Verification with Authy

Page 3: Adding Two Factor Authentication to your App with Authy

What is 2FA?!

Page 4: Adding Two Factor Authentication to your App with Authy

Two Factor Authentication

Page 5: Adding Two Factor Authentication to your App with Authy

Step

One act of providing authentication

Factor

An independent source of

authentication

Page 6: Adding Two Factor Authentication to your App with Authy

Something You KnowSomething You HaveSomething You Are

Page 7: Adding Two Factor Authentication to your App with Authy

SMS:something you have???

Authy / GA:something you have???

Page 8: Adding Two Factor Authentication to your App with Authy

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

Dongle thingies

Independent. Possession required.

Page 10: Adding Two Factor Authentication to your App with Authy

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

Example video time!

Page 12: Adding Two Factor Authentication to your App with Authy

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

What Do Customers Get Out Of It?

Page 14: Adding Two Factor Authentication to your App with Authy

What Do I Get Out Of It?

Page 15: Adding Two Factor Authentication to your App with Authy

Why use Authy?

Page 16: Adding Two Factor Authentication to your App with Authy

Let’s build it!

Page 17: Adding Two Factor Authentication to your App with Authy

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
Page 19: Adding Two Factor Authentication to your App with Authy

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

1) Sign up & install Authy

Page 21: Adding Two Factor Authentication to your App with Authy
Page 22: Adding Two Factor Authentication to your App with Authy

/config/secrets.yml

/config/initializers/authy.rb

Page 23: Adding Two Factor Authentication to your App with Authy

2) Let users turn on 2FA

Page 24: Adding Two Factor Authentication to your App with Authy

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

/app/controllers/two_factor_authentication_controller.rb

Page 26: Adding Two Factor Authentication to your App with Authy

/app/views/two_factor_authenticator/setup.html.erb

Page 27: Adding Two Factor Authentication to your App with Authy

localhost:3000/two_factor_authentication/setup

Page 28: Adding Two Factor Authentication to your App with Authy

/app/controllers/two_factor_authentication_controller.rb

Page 29: Adding Two Factor Authentication to your App with Authy

/app/views/two_factor_authenticator/verify.html.erb

Page 30: Adding Two Factor Authentication to your App with Authy

localhost:3000/two_factor_authentication/verify

Page 31: Adding Two Factor Authentication to your App with Authy
Page 32: Adding Two Factor Authentication to your App with Authy

/app/controllers/two_factor_authentication_controller.rb

Page 33: Adding Two Factor Authentication to your App with Authy

Yay, 2FA is turned on!

Page 34: Adding Two Factor Authentication to your App with Authy

3) Use it when they sign in

Page 35: Adding Two Factor Authentication to your App with Authy

/app/controllers/sessions_controller.rb

Page 36: Adding Two Factor Authentication to your App with Authy

/app/controllers/sessions_controller.rb

Page 37: Adding Two Factor Authentication to your App with Authy

localhost:3000/sessions/two_factor_required

Page 38: Adding Two Factor Authentication to your App with Authy

/app/controllers/sessions_controller.rb

Page 39: Adding Two Factor Authentication to your App with Authy
Page 40: Adding Two Factor Authentication to your App with Authy

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

Thanks! Questions??github.com/nickmalcolm/twofactorexample

@nickmalcolmrevert.io