Skip to content

Commit 39e2a4e

Browse files
author
ade@google.com
committed
Applied Will Norris's patch so that OAuth will work on localhost in the appengine Buzz sample
1 parent 3fada33 commit 39e2a4e

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

samples/appengine/main.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@
3333
from google.appengine.ext.webapp import util
3434
from google.appengine.ext.webapp.util import login_required
3535

36-
STEP2_URI = 'http://%s.appspot.com/auth_return' % os.environ['APPLICATION_ID']
37-
3836

3937
class Flow(db.Model):
4038
# FlowThreeLegged could also be stored in memcache.
@@ -77,7 +75,8 @@ def get(self):
7775
scope='https://www.googleapis.com/auth/buzz',
7876
xoauth_displayname='Example Web App')
7977

80-
authorize_url = flow.step1_get_authorize_url(STEP2_URI)
78+
callback = self.request.relative_url('/auth_return')
79+
authorize_url = flow.step1_get_authorize_url(callback)
8180
f = Flow(key_name=user.user_id(), flow=flow)
8281
f.put()
8382
self.redirect(authorize_url)

0 commit comments

Comments
 (0)