1

I need to modify the calendars of my users from a back end application. I have executed the authorization/authentication flow code on the client side (using Javascript libraries) and posted the Access token to the server for further processing. How do I modify this code to do the job ?

        string[] scopes = new[] { CalendarService.Scope.Calendar };
        ClientSecrets secrets = new ClientSecrets() {        
            ClientId = MY_CLIENT_ID,
            ClientSecret = MY_CLIENT_SECRET
        };
        UserCredential credential = GoogleWebAuthorizationBroker.AuthorizeAsync(
            secrets,
            scopes,
            "user",
            CancellationToken.None).Result;

        var service = new CalendarService(new BaseClientService.Initializer()
        {
            HttpClientInitializer = credential,
            ApplicationName = MY_APPLICATION
        });

It is my understanding that no further Authorization required, as the server has the access token. So there should be some other type of initialization to the CalendarService... However I cannot figure how to do that.

Thanks

0 Answers0