Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Choosing the Right Authentication Strategy - Ga...

Sponsored · Your Podcast. Everywhere. Effortlessly. Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
Avatar for Las Vegas Ruby Group Las Vegas Ruby Group
September 11, 2013
82

Choosing the Right Authentication Strategy - Gabe Evans

Avatar for Las Vegas Ruby Group

Las Vegas Ruby Group

September 11, 2013
Tweet

Transcript

  1. BEFORE WE BEGIN • The title of this presentation is

    half a lie. This is no “right” way. There is, however, the best way depending on your situation. • I sign into many different websites daily. As such, I consider myself an expert. • The goal is to present the options, their benefits, and shortcomings.
  2. Authentication vs. Authorization Authorization verifies what you can do. Authentication

    verifies who you are. Source: https://secure.flickr.com/photos/mcgovernville/48178733/
  3. OAuth • Doubles as authentication for users of your apps

    while requesting privileges to data through providers (e.g. Facebook Graph API). • Credentials are le" in the hands of the provider. If they’re compromised, you’re compromised. • Easy to offer too many options and raises privacy concerns. • There are three different versions in use.
  4. OpenID • Decentralized. Authentication is through a URL, rather than

    a specific provider. • Credentials are le" in the hands of the provider. If they’re compromised, you’re compromised.
  5. HTTP Authentication • Oldest, most well supported web-based authentication. •

    Easiest implementation for simple API clients. • Ugly to users. • Basic is insecure, Digest is overly complex.
  6. SMS One-Time Passwords • If your users have a computer,

    they have a cellphone capable of receiving text messages. • However, they’re the weakest second factor (OTPs can be read when your phone is locked).
  7. Biometric Authentication • Can be any kind of (but not

    limited to) fingerprint or retina scanning, facial or voice recognition, or a signature. • In theory, identifies an individual and cannot be replicated. • Expensive, difficult to implement, young, and o"en times easy to exploit.
  8. USB One-Time Password Authenticators • Must be in your users’

    possession to authenticate. • Costs money. • Small and easy to lose.
  9. LaunchKey • Supports many factors of authentication: PIN, pattern, geofencing,

    device factor (Bluetooth). • Usable through OpenID and OAuth. • Recently out of private beta, not in widespread production use (yet).
  10. Devise • Most support and documentation. • Requires Ruby on

    Rails. • Includes everything but the kitchen sink. • Difficult to customize.
  11. OmniAuth • Alternative to all-in-one solutions (Devise). • Supports almost

    every OAuth provider imaginable. • Works with any Rack-based application. • Can be too minimal for spoiled Rails developers.
  12. Use Warden for Authentication • Works as a Rack middleware.

    • Specifies authentication strategies in a DSL. • Used by Devise.
  13. Use has_secure_password in Models • Avoids the trouble of picking

    a hashing algorithm (uses bcrypt). • Includes minimal validations for password and password confirmation. • Adds a total of 3 methods: #authenticate, #password=, #password_confirmation=