From 39e2a4e22353e954c6e091a49b71bd5dd25fb9e5 Mon Sep 17 00:00:00 2001 From: "ade@google.com" Date: Mon, 10 Jan 2011 00:33:07 +0000 Subject: [PATCH] Applied Will Norris's patch so that OAuth will work on localhost in the appengine Buzz sample --- samples/appengine/main.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/samples/appengine/main.py b/samples/appengine/main.py index 9f63d50..06d1d06 100755 --- a/samples/appengine/main.py +++ b/samples/appengine/main.py @@ -33,8 +33,6 @@ from google.appengine.ext.webapp import template from google.appengine.ext.webapp import util from google.appengine.ext.webapp.util import login_required -STEP2_URI = 'http://%s.appspot.com/auth_return' % os.environ['APPLICATION_ID'] - class Flow(db.Model): # FlowThreeLegged could also be stored in memcache. @@ -77,7 +75,8 @@ class MainHandler(webapp.RequestHandler): scope='https://www.googleapis.com/auth/buzz', xoauth_displayname='Example Web App') - authorize_url = flow.step1_get_authorize_url(STEP2_URI) + callback = self.request.relative_url('/auth_return') + authorize_url = flow.step1_get_authorize_url(callback) f = Flow(key_name=user.user_id(), flow=flow) f.put() self.redirect(authorize_url)