I need to use SpreadsheetsService, but I don't find the way in the official 
documentation .net.
https://developers.google.com/google-apps/spreadsheets/?hl=ja#authorizing_requests

I have my service authenticated:

String serviceAccountEmail = "[email protected]";
var certificate = new X509Certificate2(@"privatekey.p12", "pass", 
X509KeyStorageFlags.Exportable);
ServiceAccountCredential credential = new ServiceAccountCredential(
    new ServiceAccountCredential.Initializer(serviceAccountEmail)
    {
        Scopes = new[] { DriveService.Scope.Drive }
    }.FromCertificate(certificate));

>From here I can instantiate almost any service.

For example Drive Service:

var service = new DriveService(new BaseClientService.Initializer()
    {
            HttpClientInitializer = credential,
            ApplicationName = "Drive API Sample",
    });

But with SpreadsheetsService I can do this, because SpreadsheetsService 
wait for an string 'application name' in his default constructor or an 
GOAuth2RequestFactory in his property RequestFactory.

How to authenticate SpreadsheetsService with an ServiceAccountCredential?

Thanks in advance.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Spreadsheets API" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to