Siwar Ha
Member
- Joined
- May 28, 2021
- Messages
- 5
- Programming Experience
- Beginner
C#:
public static DriveService Execution(string ApplicationName, string credentials)
{
UserCredential credential;
using (var stream =
new FileStream(credentials, FileMode.Open, FileAccess.Read))
{
string credPath = "token.json";
credential = GoogleWebAuthorizationBroker.AuthorizeAsync(
GoogleClientSecrets.Load(stream).Secrets,
Scopes,
"XXXX",
CancellationToken.None,
new FileDataStore(credPath, true)).Result;
}
// Create Drive API service.
var service = new DriveService(new BaseClientService.Initializer()
{
HttpClientInitializer = credential,
ApplicationName = ApplicationName,
});
return service;
}
I know that i have to replace GoogleWebAuthorizationBroker with GoogleAuthorizationCodeFlow but i didnt get what should REFRESH_TOKEN get like value ?
any help please ?