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

Flask-Dance

42c77de97965d620ba0b6ae624c3ba7b?s=47 David Baumgold
November 17, 2015

 Flask-Dance

OAuth is a pain. Flask-Dance makes it better. Learn how the Flask-Dance library was created, and why it makes it easier to use OAuth-enabled APIs like Facebook, Twitter, Google, GitHub, and a lot more.

42c77de97965d620ba0b6ae624c3ba7b?s=128

David Baumgold

November 17, 2015
Tweet

Transcript

  1. FLASK-DANCE Making OAuth Simpler David Baumgold // @singingwolfboy

  2. APIS ARE EVERYWHERE

  3. OAUTH IS EVERYWHERE

  4. OAUTH IS A PAIN

  5. source: http://ravi-bhide.blogspot.com/2010/05/oauth-protocol-simplified.html

  6. http://www.ibuildings.nl/blog/2013/03/secure-your-rest-api-oauth2-implicit-grant

  7. “This story is a ‘Happy Path’ scenario, it doesn't account

    for token expiry (Access Tokens should expire after a short duration) or errors signing in. In order to get the full details I'd recommend reading the RFC.
  8. LET’S IGNORE IT!

  9. None
  10. ... WELL CRAP.

  11. HOW DO I EVEN OAUTH?

  12. None
  13. Sweet!

  14. EASY!

  15. UH, OK

  16. HUH?

  17. WAT.

  18. FLASK-OAUTH ➤ Uses the oauth2 module to handle OAuth stuff


    (which only supports OAuth 1.0, not OAuth 2.0) ➤ Uses the httplib2 module to handle HTTP stuff
 (instead of the fabulous requests module) ➤ Lots of boilerplate code
  19. This one!

  20. Yay!

  21. WAT.

  22. FLASK-OAUTHLIB ➤ Uses the oauthlib module to handle OAuth stuff.

    
 This is actually a good thing! ➤ Uses the terrible urllib2 module to handle HTTP stuff
 (instead of the fabulous requests module) ➤ Lots of boilerplate code
  23. FINE, I’LL DO IT MYSELF

  24. FlaskDance Because all the obvious names were taken.

  25. BASIC FLASK APP

  26. BASIC FLASK APP WITH TWITTER

  27. FLASK-DANCE ➤ Uses the oauthlib module to handle OAuth stuff

    ➤ Uses the requests module to handle HTTP stuff ➤ Uses Flask’s “blueprints” feature to reduce boilerplate code ➤ Sensible defaults for getting started quickly ➤ Useful extension points: different services, different databases ➤ Automated tests with 95% code coverage ➤ Supports the following services out of the box: Facebook, GitHub, Google, Twitter, JIRA, Dropbox, Meetup (or add your own!)
  28. ON TO THE DOCS https://flask-dance.readthedocs.org

  29. I NEED YOUR HELP

  30. WAYS YOU CAN HELP ➤ Try out Flask-Dance, and tell

    me what you think of it! ➤ Use it in your projects! ➤ Help improve the documentation! ➤ Add more builtin providers! ➤ Help build a server component! ➤ Tell your friends that OAuth doesn’t have to be painful anymore! ANY QUESTIONS? David Baumgold // @singingwolfboy