title: GoogleCredential created by json private key file (ServiceAccount) - how to set the User to impersonate?
body: <p>just starting with Google Apis. 
  In my Google Cloud Platform account i created a Service Account for domain wide delegation. I saved a private key file in json format for this service account. </p>
  
  <p>In my test application i am creating a GoogleCredential instance:</p>
  
  <pre><code>var credential = 
              GoogleCredential.FromStream(new FileStream("privatekey.json", FileMode.Open, FileAccess.Read))
              .CreateScoped(Scopes);
  </code></pre>
  
  <p>How can i set the user i want to impersonate?
  When using a p12 private key i could do the following:</p>
  
  <pre><code>var credential = new ServiceAccountCredential(
      new ServiceAccountCredential.Initializer("xxx@developer.gserviceaccount.com") //service Account id
      {
         Scopes = Scopes,
         User = "admin@xxx.com" //the user to be impersonated                    
      }.FromCertificate(new X509Certificate2(@"xxx.p12", "notasecret", X509KeyStorageFlags.Exportable)));
  </code></pre>
  
  <p>But how can i do this "the easy way" with GoogleCredential and a json privatkey file?</p>
  
  <p>Kind regards</p>