title: HttpListenerException "access is denied" using GoogleWebAuthorizationBroker.AuthorizeAsync
body: <p>I'm trying to do OAuth2 using Azure hosted web apps, and I can't use service accounts (there is a number of solutions available here, but they all stick to service accounts/certs), while I need the user to authenticate and authorize by Google.</p>
  
  <p>Code:</p>
  
  <pre><code>var credential = GoogleWebAuthorizationBroker.AuthorizeAsync(
      new ClientSecrets { ClientId = _clientId, ClientSecret = _clientSecret },
      scopes,
      User.Identity.Name,
      CancellationToken.None,
      new FileDataStore("GA.Auth.Store")) /* tried this to be null as well */
      .Result;
  
  var service = new AnalyticsService(
      new BaseClientService.Initializer()
      {
          HttpClientInitializer = credential,
          ApplicationName = "Analytics API Sample"
      });
  </code></pre>
  
  <p>It works locally but gives this exception when deployed as an Azure web app:</p>
  
  <pre><code>[HttpListenerException (0x5): Access is denied]
  Microsoft.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +82
  Microsoft.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccess(Task task) +76
  Google.Apis.Auth.OAuth2.&lt;AuthorizeAsync&gt;d__1.MoveNext() +233
  </code></pre>
  
  <p>I am guessing that <em>GoogleWebAuthorizationBroker.AuthorizeAsync</em> is trying to establish an http listener which is not (?) possible within Azure web apps.</p>
  
  <p>I tried using Azure web apps authentication.  This does authenticate user, but how can I retrieve the authenticated user to authorize him against Google?</p>
  
  <p>BTW: Because I need GA Real-Time, I am stuck with GA Reporting v3 library.</p>