Google App Engine (GAE) OAuth 2.0 sample, based on google-api-python-client samples/appengine and modified.
- use virtualenv.
- use webapp2 and jinja2 instead of webapp
- Create a GAE application at GAE my applications page.
- Create a project and Client ID at Developers console. See Google Developers Console Help — Google Developers.
- For running a local application. Note the scheme is http, not https.
- JavaScript Origins: http://localhost:8080
- Redirect URIs: http://localhost:8080/oauth2callback
- For running an application on GAE. Note the scheme is https, not http. Replace jovial-totality-414 with your application ID.
- JavaScript Origins: https://jovial-totality-414.appspot.com
- Redirect URIs: https://jovial-totality-414.appspot.com/oauth2callback
- Press the [Download JSON] button and save the downloaded file as client_secrets.json.
On a mac, you can use homebrew.
brew install python
brew install google-app-engine
pip install virtualenv
./virtual_env_setup.sh
. ./bin/activate
application: jovial-totality-414
version: 1
dev_appserver.py .
- Open http://localhost:8080 in your browser.
- Click the "proceed to the main application" link.
- Click the "Grant" link in "Grant this application permission to read your Buzz information and it will let you know how many followers you have."
- Grant your application titled "Project Default Service Account"
- Click the "proceed to the main application" link.
- The browser redirects to http://localhost:8080/about, and it prints "Hello, ${your name on Google+ here}".
appcfg.py --oauth2 update .
See Uploading, Downloading, and Managing a Python App - Python — Google Developers
- Open https://jovial-totality-414.appspot.com in your browser (Replace jovial-totality-414 with your application ID).
- Click the "proceed to the main application" link.
- Click the "Grant" link in "Grant this application permission to read your Buzz information and it will let you know how many followers you have."
- Grant your application titled "Project Default Service Account"
- Click the "proceed to the main application" link.
- The browser redirects to https://jovial-totality-414.appspot.com/about, and it prints "Hello, ${your name on Google+ here}".
Simple Google+ sample that demonstrates the people API. Demontrates using the OAuth 2.0 Decorator for Google App Engine applications. api: plus keywords: appengine oauth2