title: Error trying to impersonate account when accessing google api (for my business)
body: <p>I've been trying to access Googles Mybusiness API, but it seems a bit harder than the documentation states.</p>
  
  <p>I have created a service account, that has access to everything I can think of, but still when trying to connection or access an API-resource, I get an error saying:</p>
  
  <pre><code>'Error:"invalid_request", Description:"Invalid impersonation prn email address.", Uri:""'
  </code></pre>
  
  <p>As far as I can tell, this indicates that the service account does not have permission to impersonate the account that is setup as administrator in Google My Business.</p>
  
  <p>Almost every search result I find, mentions that the service account should be a G Suite Administrator. Neither the service account or the GMB administrator is in any G Suite-related setup, so even adding that permission to the service account has no effect.</p>
  
  <p>How do I grant access to the API for the service account?</p>
  
  <p>I have tried several methods to connect. Using the certificate was the only one where I was able to add a username, of the user I wish to impersonate:</p>
  
  <pre><code>        var certificate = new X509Certificate2(System.IO.Path.Combine(path, p12FileName), "notasecret", X509KeyStorageFlags.MachineKeySet | X509KeyStorageFlags.Exportable);
  
          var initializer = new ServiceAccountCredential.Initializer(serviceAccount)
          {
              Scopes = new[] { "https://www.googleapis.com/auth/plus.business.manage" },
              User = user,
          };
  
          var credential = new ServiceAccountCredential(initializer.FromCertificate(certificate))
          {
          };
  
          var myBusinessService = new MyBusinessService(new BaseClientService.Initializer()
          {
              HttpClientInitializer = credential,
          });
  </code></pre>