Drop-in App Engine OAuth client handlers for many popular sites.
Project description
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+, Instagram, Twitter, Tumblr, and WordPress.com.
Check out the demo app! https://oauth-dropins.appspot.com/
Quick start
Here’s a full example of using the Facebook drop-in.
Put your Facebook application’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.)
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'))]
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file oauth-dropins-1.2.tar.gz.
File metadata
- Download URL: oauth-dropins-1.2.tar.gz
- Upload date:
- Size: 676.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bf7b0865a538230aa4521b59c96dc6e08c9ec9464e698e0217e3f95895a838ed
|
|
| MD5 |
4c73c3d5d8e070110b052660b2e8839c
|
|
| BLAKE2b-256 |
a550d56c9cd4f4fb6186c35221d4b92cf228a99ce04ae59978de7dcedd974a71
|