title: Google Drive Api uploading files to incorrect Google Drive account
body: <p>I have implemented file upload to Google Drive functionality in my project.
  Following is the credentials (client key and client secret key) json file which I downloaded from Google.</p>
  
  <pre><code>{
  "web": {
      "client_id": "cid",
      "project_id": "projectid",
      "auth_uri": "https://accounts.google.com/o/oauth2/auth",
      "token_uri": "https://accounts.google.com/o/oauth2/token",
      "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
      "client_secret": "cse"
  }
  }
  </code></pre>
  
  <p>Below code shows the access token json file which is generated in my machine using this code.</p>
  
  <pre><code>  using (var stream = new FileStream("drive.json", FileMode.Open, FileAccess.Read))
          {
              string credPath = System.Environment.GetFolderPath(
                  System.Environment.SpecialFolder.Personal);
              credPath = System.IO.Path.Combine(credPath, ".credentials/accesstoken.json");
  
              credential = GoogleWebAuthorizationBroker.AuthorizeAsync(
                  GoogleClientSecrets.Load(stream).Secrets,
                   Scopes,
                  "a.b@gmail.com",
                  CancellationToken.None,
                  new FileDataStore(credPath, true)).Result;
              Console.WriteLine("Credential file saved to: " + credPath);
          }
          //create Drive API service.
          Google.Apis.Drive.v3.DriveService service = new Google.Apis.Drive.v3.DriveService(new BaseClientService.Initializer()
          {
              HttpClientInitializer = credential,
              ApplicationName = "DriveProjectName",
          });
  </code></pre>
  
  <p>File upload functionality is working good, but when I copy my code from one PC to another PC and rum my project code ,if any other gmail account (eg. x.z@gmail.com) is logged in on that PC , the file gets uploaded to that account's drive instead of my Google Drive.</p>
  
  <p>Why is this happening? Is this issue related to any google drive permissions or defining scopes? Any particular setting that needs to be done in Google Drive or in my code that I am missing? I have defined following scopes in my code</p>
  
  <pre><code>public static string[] Scopes =
  {
       Google.Apis.Drive.v3.DriveService.Scope.Drive, 
       Google.Apis.Drive.v3.DriveService.Scope.DriveFile, 
       Google.Apis.Drive.v3.DriveService.Scope.DriveMetadata, 
       Google.Apis.Drive.v3.DriveService.Scope.DriveAppdata
  };
  </code></pre>
  
  <p>Any suggestions or ideas?</p>