S
S
shevchenko_ch2015-12-05 21:26:12
Google
shevchenko_ch, 2015-12-05 21:26:12

How to get ad_units list via Google Adsense Management API from ASP.NET 5 controller?

In startup.cs:

services.AddAuthentication(options => options.SignInScheme = CookieAuthenticationDefaults.AuthenticationScheme);
app.UseGoogleAuthentication(options =>
{
options.ClientId = "560027070069-37ldt4kfuohhu3m495hk2j4pjp92d382.apps.googleusercontent.com";
options.ClientSecret = "n2Q-GEw9RQjzcRbU3qhfTj8f";
options.Events = new O =>
{ AuthEventxError ( ) .Response.Redirect("/error?ErrorMessage=" + UrlEncoder.Default.Encode(ctx.Error.Message)); ctx.HandleResponse();
return Task.FromResult(0);
}
};
});

Get-request in controller returns 401(Unauthorized)
What am I doing wrong?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question