Not found in class GoogleWebAuthorizationBroker Library Google.Apis.Auth.OAuth2

Discussion in 'Google API' started by insidedocument, Jul 3, 2014.

  1. #1
    Create an application for example https://developers.google.com/google-apps/calendar/instantiate but the library from Google not have the right class. What to do where to look;

    usingSystem;usingSystem.Threading;usingSystem.Threading.Tasks;usingGoogle;usingGoogle.Apis.Auth.OAuth2;usingGoogle.Apis.Calendar.v3;usingGoogle.Apis.Calendar.v3.Data;usingGoogle.Apis.Services;namespaceCalendar.Sample{
    classProgram
    {
    staticvoidMain(string[] args)
    {
    UserCredential credential =GoogleWebAuthorizationBroker.AuthorizeAsync(
    newClientSecrets
    {
    ClientId="CLIENT_ID_HERE",
    ClientSecret="CLIENT_SECRET_HERE",
    },
    new[]{CalendarService.Scope.Calendar},
    "user",
    CancellationToken.None).Result;

    // Create the service.
    var service =newCalendarService(newBaseClientService.Initializer()
    {
    HttpClientInitializer= credential,
    ApplicationName="Calendar API Sample",
    });

    ...
    }
    }}
     
    insidedocument, Jul 3, 2014 IP