I have an installed c# app with code working that gets the authorization code and exchanges it for an access token. I am storing off the refresh token. I know at some poin
From what I understand you use the refresh token when you do not wish to authenticate your app each time it boots. This is extremely useful for debugging during application development (as manual authentication can get annoying after a while).
In the most basic sense:
public static GOAuth2RequestFactory RefreshAuthenticate(){
OAuth2Parameters parameters = new OAuth2Parameters(){
RefreshToken = "",
AccessToken = "",
ClientId = "",
ClientSecret = "",
Scope = "https://spreadsheets.google.com/feeds https://docs.google.com/feeds",
AccessType = "offline",
TokenType = "refresh"
};
string authUrl = OAuthUtil.CreateOAuth2AuthorizationUrl(parameters);
return new GOAuth2RequestFactory(null, "", parameters);
}
You would use this method in other code with a service, perhaps like this
GOAuth2RequestFactory requestFactory = RefreshAuthenticate();
SpreadsheetsService service = new SpreadsheetsService("");
service.RequestFactory = requestFactory;
Hope this helps!