I need to write sample code I need to allow [email protected], [email protected], [email protected],... access to all my files([email protected]) in google drive account using sdk. I tried this(install application on google developers console), and the service returns the files of user which login in browser in current time
ClientSecrets secrets = new ClientSecrets
{
ClientId = CLIENT_ID,
ClientSecret = CLIENT_SECRET,
};
IDataStore StoredRefreshToken = new SavedDataStore(new StoredResponse() { });
UserCredential credential = GoogleWebAuthorizationBroker.AuthorizeAsync(secrets,
SCOPES, "1", CancellationToken.None, StoredRefreshToken /*, credentialPersistanceStore*/).Result;
BaseClientService.Initializer initializer = new BaseClientService.Initializer
{
HttpClientInitializer = credential,
ApplicationName = APP_USER_AGENT
};
return new DriveService(initializer);
I write on asp.net mvc, hope you are hepls