在谷歌文档中说
// Once the user authorizes with Google, the request token can be exchanged
// for a long-lived access token. If you are building a browser-based
// application, you should parse the incoming request token from the url and
// set it in OAuthParameters before calling GetAccessToken().
但它没有说明或显示如何做到这一点:(
有人知道如何为桌面应用执行此操作吗?
非常欢迎代码示例!
最佳答案
好的,过了一段时间我解决了。
获得访问 token 后,您还会获得刷新 token 。存储该 token !
同时执行此操作 parameters.AccessToken = StoredRefreshToken
和 parameters.RefreshToken = StoredRefreshToken
在发出下一个请求之前调用 OAuthUtil.RefreshAccessToken(parameters);
然后你就可以提出请求了!
关于c# - 如何获得长期访问 token Google API,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10556864/