在什么情况下(除了有人撤销更改gmail密码的权限),用户需要重新授权应用程序访问他们的gmail数据?我的应用程序存储并使用刷新令牌来维护当前的访问令牌,但我的用户偶尔仍会被要求从头开始授权,有时这会失败,只有当他们重置浏览器设置时才能再次生效。
发布于 2021-03-05 17:43:43
导致刷新令牌过期。
这应该差不多了,除非你考虑到2015秋季的bug,它导致了一堆刷新令牌由于夏令时而过期。(那是有趣的一天)
发布于 2021-03-13 18:11:27
I'm not storing anything explicitly, it's all being done by Google's Authorization Broker. Here's the code:
UserCredential credential;
using (FileStream credentialsfile = new FileStream(Application.StartupPath + @"/credentials.json", FileMode.Open, FileAccess.Read))
{
string credPath = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
credPath = Path.Combine(credPath, ".credentials/SJGmailAPI.json");
credential = GoogleWebAuthorizationBroker.AuthorizeAsync(GoogleClientSecrets.Load(credentialsfile).Secrets, Scopes, senderemailaddress, CancellationToken.None, new FileDataStore(credPath, true)).Result;
}
bool rc = AuthTest.TestAuthorisation(credential,senderemailaddress,ApplicationName);
So is Google's own code storing the wrong refresh token then?
https://stackoverflow.com/questions/66489693
复制相似问题