Google.Apis client for C#sharp auth using refresh token

与世无争的帅哥 提交于 2019-12-06 08:15:36

You can check if the current Token is expired and Refresh using the code below:

if (credential.Token.IsExpired(Google.Apis.Util.SystemClock.Default))
{
  var refreshResult = credential.RefreshTokenAsync(CancellationToken.None).Result;
}

After that the credential has the credential.Token.AccessToken and credential.Token.RefreshToken refreshed

peleyal

I already answer to that one in the following thread: .NET Google api 1.7 beta authenticating with refresh token

Hope it will be helpful for you as well.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!