title: Google Drive simple API Access authorization fail
body: <p>I'm trying to authorize in google using .NET SDK provided, but it failes with "Invalid credentials" error. I found this answer</p>
  
  <p><a href="https://stackoverflow.com/questions/8899000/c-sharp-google-calendar-v3-2-legged-authentication-fails/9195058#9195058">Google Calendar V3 2 Legged authentication fails</a></p>
  
  <p>but I still don't see where is the mistake. Looks like everything is done as described.</p>
  
  <p>Here is my code</p>
  
  <pre><code>const string CONSUMER_KEY = "mytestdomain.com";
  const string CONSUMER_SECRET = "my_consumer_secret";
  const string TARGET_USER = "user";
  const string SERVICE_KEY = "some_api_key";
  
  var auth = new OAuth2LeggedAuthenticator(CONSUMER_KEY, CONSUMER_SECRET, TARGET_USER, CONSUMER_KEY);
  
  var service = new DriveService(auth) { Key = SERVICE_KEY };
  var results = service.Files.List().Fetch();
  
  Console.WriteLine(results.Items.Count);
  </code></pre>
  
  <p>and here are screenshots from google control panel. I just replaced <code>domain name</code>, <code>consumer key</code> and <code>api key</code>.</p>
  
  <p>Screenshot from <code>Manage API client access</code> page
  <img src="https://i.stack.imgur.com/0D4UU.png" alt="Screenshot from &quot;Manage API client access&quot; page"></p>
  
  <p>Screenshot from <code>Manage OAuth key and secret for this domain</code> page
  <img src="https://i.stack.imgur.com/sywjV.png" alt="Screenshot from &quot;Manage OAuth key and secret for this domain&quot; page"></p>
  
  <p>Screenshot from <code>API Access</code> page in <code>Google API console</code>
  <img src="https://i.stack.imgur.com/0Z2Vz.png" alt="Screenshot from &quot;API Access&quot; page in &quot;Google API console&quot;"></p>