Is there any code example of a desktop application how to authorize to Google Drive service and upload a file?
Currently I have:
var parameters = new OAuth2Parameters
{
ClientId = ClientCredentials.ClientId,
ClientSecret = ClientCredentials.ClientSecret,
RedirectUri = ClientCredentials.RedirectUris[0],
Scope = ClientCredentials.GetScopes()
};
string url = OAuthUtil.CreateOAuth2AuthorizationUrl(parameters);
// Open url, click to allow and copy secret code
parameters.AccessCode = secretCodeFromBrowser;
OAuthUtil.GetAccessToken(parameters);
string accessToken = parameters.AccessToken;
// So, there is the access token
But what are the next steps? As I see from examples I should get IAuthenticator instance and pass it into constructor of DriveService class... How to get an instance of IAuthenticator? If my above code is correct... Thanks in advance.