0

我对这个答案感到非常满意https://stackoverflow.com/a/8548319/641264因为有了它,我现在很好地理解了访问令牌和刷新令牌之间的区别。我还浏览了 OAuth2WebSercer 文档https://developers.google.com/accounts/docs/OAuth2WebServer 但我不知道可用于处理刷新令牌的函数/方法。对于访问令牌,我们使用:

gdata.gauth.ae_save()
gdata.gauth.ae_load()
token.get_access_token()

但是刷新令牌呢?

4

1 回答 1

0

If you step your way down into the source:
[ae_save source]
[token_to_blob source]

you'll see that token_to_blob is called on the token itself when you call ae_save.

In particular:

elif isinstance(token, OAuth2Token):
  return _join_token_parts(
      '2o', token.client_id, token.client_secret, token.scope,
      token.user_agent, token.auth_uri, token.token_uri,
      token.access_token, token.refresh_token)

so not just the access token is saved, but many other attributes of the token object.

于 2012-07-17T15:22:09.937 回答