I'm working on a service that requires authorization server to server to Google Maps Engine.
https://developers.google.com/maps-engine/documentation/oauth/serviceaccount and https://developers.google.com/api-client-library/dotnet/guide/aaa_oauth?hl=en#service_account explains how to do this.
But, in the Google APIs. NET yet, do not have the class of service for Google Maps Engine API, then I would like to take part of the flow of the library, because I do not want to do all the hard work of managing JWT.
I think something like:
var certificate = new X509Certificate2(@"key.p12", "notasecret", X509KeyStorageFlags.Exportable);
ServiceAccountCredential credential = new ServiceAccountCredential(
new ServiceAccountCredential.Initializer(serviceAccountEmail)
{
Scopes = new[] { "https://www.googleapis.com/auth/mapsengine" }
}.FromCertificate(certificate));
var request = (HttpWebRequest)WebRequest.Create("https://www.googleapis.com/mapsengine/v1/projects");
credential.ApplyAuthenticationToRequest(request);
I want to use a pure HttpWebRequest, however using the certificate.
Could someone help me?
Alex