GAE:OAuth 2.0授权网址无法加载到Google协作平台小工具中

时间:2013-01-21 12:03:49

标签: google-app-engine python-2.7 oauth-2.0 google-sites google-api-client

我有一个Python应用程序,在Google App Engine中执行。该应用使用Google Calendar API和api-client-library。我的代码简化,如下所示:

import webapp

oauth2_decorator = oauth2decorator_from_clientsecrets(
    CLIENT_SECRETS,
    scope=CALENDAR_SCOPE,
    message=MISSING_CLIENT_SECRETS_MESSAGE)

class MyRequestHandler(webapp2.RequestHandler):
  @oauth2_decorator.oauth_aware
  def get(self):
    if oauth2_decorator.has_credentials():
      # do stuff
    else:
      self.response.out.write(oauth2_decorator.authorize_url())


app = webapp2.WSGIApplication([
    ('/', MyHandleRequest),
    (oauth2_decorator.callback_path, oauth2_decorator.callback_handler())
], debug=True)

到目前为止,这么好。第一次用户进入应用程序时,它会请求授权使用用户的日历。用户提供授权,然后应用程序正常运行。

当我使用Google协作平台小工具将应用程序集成到Google网站时,会出现问题。用户第一次进入时,小工具会显示空白内容。如果用户直接打开该小工具的内容(appspot网址),则可以正常工作:加载了授权网址并且该应用有效。

Google协作平台中集成的appspot网址是否存在任何已知问题?

非常感谢提前

0 个答案:

没有答案