A autorização do lado do servidor da API de incorporação do Google Analytics não renderiza os gráficos com c #

Estou tentando renderizar gráficos usando a autorização do lado do servidor em c #, mas não consigo fazê-lo.

O Google tem um exemplo, mas baseado em Python e preciso criar com base em C # MVC:https://ga-dev-tools.appspot.com/embed-api/server-side-authorization/

Eu criei a conta de serviço e baixei o arquivo JSON:

Controler

public class StatsController : Controller
{
    // GET: Stats
    public async Task<ActionResult> Index()
    {
        var json = "C:\\temp\\client_secrets.json";

        string[] scopes = new string[] { AnalyticsReportingService.Scope.AnalyticsReadonly }; // Put your scopes here

        var stream = new FileStream(json, FileMode.Open, FileAccess.Read);

        var credential = GoogleCredential.FromStream(stream);
        credential = credential.CreateScoped(scopes);

        try
        {
            Task<string> task = ((ITokenAccess)credential).GetAccessTokenForRequestAsync();
            task.Wait();
            var bearer = task.Result;

            ViewBag.Token = bearer;
        }
        catch (AggregateException ex)
        {
            throw ex.InnerException;
        }

        return View();
    }
}

Visão

<script>
(function(w,d,s,g,js,fs){
  g=w.gapi||(w.gapi={});g.analytics={q:[],ready:function(f){this.q.push(f);}};
  js=d.createElement(s);fs=d.getElementsByTagName(s)[0];
  js.src='https://apis.google.com/js/platform.js';
  fs.parentNode.insertBefore(js,fs);js.onload=function(){g.load('analytics');};
}(window,document,'script'));
</script>

<div id="chart-1-container"></div>

<script>

gapi.analytics.ready(function() {

  /**
   * Authorize the user with an access token obtained server side.
   */
  gapi.analytics.auth.authorize({
    'serverAuth': {
      'access_token': '{{ @ViewBag.Token }}'
    }
  });


  /**
   * Creates a new DataChart instance showing sessions over the past 30 days.
   * It will be rendered inside an element with the id "chart-1-container".
   */
  var dataChart1 = new gapi.analytics.googleCharts.DataChart({
    query: {
      'ids': 'ga:XXXX', // <-- Replace with the ids value for your view.
      'start-date': '30daysAgo',
      'end-date': 'yesterday',
      'metrics': 'ga:sessions,ga:users',
      'dimensions': 'ga:date'
    },
    chart: {
      'container': 'chart-1-container',
      'type': 'LINE',
      'options': {
        'width': '100%'
      }
    }
  });
  dataChart1.execute();

});
</script>

Nada é processado, e recebo um token diferente toda vez que atualizo o View e todos esses erros no console:

Detalhe

questionAnswers(1)

yourAnswerToTheQuestion