title: GoogleWebAuthorizationBroker in MVC For Google Drive Access
body: <p>I'm stuck trying to access a specific Google drive account from a MVC app.  All I need is for the MVC web app to access my google drive scan for a few files and alter the database based on the contents of the google drive.  The problem is when running in IIS the drive cannot be authenticated as GoogleWebAuthorizationBroker tries to open browser if its a windows app but doesn't seem to be able to do that through IIS and even if it did it would be server side.</p>
  
  <p>Ideally I would not have to authenticate this app at all, but if it has do go through that then how do I make it work in IIS?</p>
  
  <pre class="lang-c# prettyprint-override"><code>UserCredential credential = GoogleWebAuthorizationBroker.AuthorizeAsync(
      new ClientSecrets
              {
                  ClientId = "MY_ID",
                  ClientSecret = "My_Secret"
              },
              new[] { DriveService.Scope.Drive },
              "user",
              CancellationToken.None, dataStore: new FileDataStore(Server.MapPath("~/app_data/googledata"))).Result;
  </code></pre>