title: Google Drive OAuth 2 flow giving invalid_scope error
body: <p>My Google Drive app requests the following scopes when exchanging a code for an access token:</p>
  
  <pre><code>https://www.googleapis.com/auth/drive.file
  https://www.googleapis.com/auth/userinfo.email
  https://www.googleapis.com/auth/userinfo.profile
  https://www.googleapis.com/auth/drive.install
  </code></pre>
  
  <p>In particular, this is the query string of the URL that is eventually being requested from Google during the exchange:</p>
  
  <p><code>code=XXXXXXXXXX&amp;grant_type=authorization_code&amp;redirect_uri=XXXXXXXXXXX&amp; scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdrive.file+ https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email +https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.profile +https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdrive.install &amp;client_id=XXXXXX.apps.googleusercontent.com&amp;client_secret=XXXXXX</code></p>
  
  <p>The response is a 400 error, with the error message "invalid_scope". What am I doing wrong?</p>
  
  <p><strong>[Edit] Additional information:</strong></p>
  
  <p>The error only happens when the user clicks through from Google Drive to create a new document. If I initiate the authentication/authorization flow from my own app, the list of scopes is accepted just fine. If the user clicks through the actual Drive app to create a new document, I get invalid_scopes.</p>
  
  <p><strong>The invalid scope is drive.install</strong>. If I remove that from the list of requested scopes when the user shows up to create a new document, things start working again. Does that make any sense at all? If the user has the Drive app installed already via us requesting that scope, why would requesting that same scope when the user shows up from the Drive app cause a problem of any kind?</p>