2
我正在使用OAuth2Decorator()
和Pytgon我正處於那個階段,我仍然不確定關於App Engine的一些事情。文檔沒有提供任何信息,或者我根本無法遵循它。所以:OAuth2Decorator是否存儲用戶憑證並更新令牌?
OAuth2Decorator()存儲用戶Crediantials?
OAuth2Decorator()會自動檢索新令牌嗎?
求索如下例所示:
decorator = OAuth2Decorator(...)
service = build("drive", "v2")
class AppHandler(BaseHandler):
@decorator.oauth_aware
def get(self):
if decorator.has_credentials():
init = service.files().list().execute(decorator.http())
items = init['items']
context = {'data': getitems(items)}
self.render_response('index.html',**context)
else:
url = decorator.authorize_url()
self.redirect(url)