Skip to main content

Drop-in App Engine OAuth client handlers for many popular sites.

Project description

https://raw.github.com/snarfed/oauth-dropins/master/oauth_dropins/static/oauth_shiny_128.png https://circleci.com/gh/snarfed/oauth-dropins.svg?style=svg https://coveralls.io/repos/github/snarfed/oauth-dropins/badge.svg?branch=master

This is a collection of drop-in Google App Engine request handlers for the initial OAuth client flows for many popular sites, including Blogger, Dropbox, Facebook, Flickr, Google+, IndieAuth, Instagram, Medium, Twitter, Tumblr, and WordPress.com.

Quick start

Here’s a full example of using the Facebook drop-in.

  1. Install oauth-dropins into your App Engine app.

  1. Put your Facebook application’s’s ID and secret in two plain text files in your app’s root directory, facebook_app_id and facebook_app_secret. (If you use git, you’ll probably also want to add them to your .gitignore.)

  1. Create a facebook_oauth.py file with these contents:

from oauth_dropins import facebook
import webapp2

application = webapp2.WSGIApplication([
  ('/facebook/start_oauth', facebook.StartHandler.to('/facebook/oauth_callback')),
  ('/facebook/oauth_callback', facebook.CallbackHandler.to('/next'))]
  1. Add these lines to app.yaml:

- url: /facebook/(start_oauth|oauth_callback)
  script: facebook_oauth.application
  secure: always

Voila! Send your users to /facebook/start_oauth when you want them to connect their Facebook account to your app, and when they’re done, they’ll be redirected to /next?access_token=... in your app.

All of the sites provide the same API. To use a different one, just import the site module you want and follow the same steps. The filenames for app keys and secrets also differ by site; appengine_config.py has the full list.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

oauth-dropins-1.8.tar.gz (794.4 kB view details)

Uploaded Source

File details

Details for the file oauth-dropins-1.8.tar.gz.

File metadata

  • Download URL: oauth-dropins-1.8.tar.gz
  • Upload date:
  • Size: 794.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for oauth-dropins-1.8.tar.gz
Algorithm Hash digest
SHA256 285362a70dd8334100ace501835d4edb58e5b0f570cf145f0187a951cb6c4b0b
MD5 d5eb226daae279ffb3eba5751d548ffe
BLAKE2b-256 6bf572972dc40b1031b9cf6f6715c8ee09ff0e77ea921a9eb0e842cdd9a72507

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page