If I understand you correctly, you are asking how can you create a new Google service, based on an existing refresh token.
So, you can do the following:
var token = new TokenResponse { RefreshToken = "YOUR_REFRESH_TOKEN_HERE" };
var credentials = new UserCredential(new GoogleAuthorizationCodeFlow(
new GoogleAuthorizationCodeFlow.Initializer
{
ClientSecrets = [your_client_secrets_here]
}), "user", token);
Then you can pass your credentials to the service's initializer.
By doing the above, GoogleAuthorizationCodeFlow will get a new access token based on you refresh token and client secrets.
Note that you must have client secrets here, without that, you won't be able to get an access token.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…