Configure Your App

All requests to the Google Tasks API require authentication. The following code demonstrates how to configure your client and authenticate using OAuth 2.0 for native applications.


Follow the setup intructions in the Java Quickstart.


Follow the setup intructions in the Python Quickstart.


Follow the setup intructions in the PHP Quickstart.


using System;
using System.Threading;
using System.Threading.Tasks;

using Google;
using Google.Apis.Auth.OAuth2;
using Google.Apis.Tasks.v1;
using Google.Apis.Tasks.v1.Data;
using Google.Apis.Services;

namespace Tasks.Sample
    class Program
        static void Main(string[] args)
            UserCredential credential = GoogleWebAuthorizationBroker.AuthorizeAsync(
                new ClientSecrets
                    ClientId = "CLIENT_ID_HERE",
                    ClientSecret = "CLIENT_SECRET_HERE",
                new[] { TasksService.Scope.Tasks },

            // Create the service.
            var service = new TasksService(new BaseClientService.Initializer()
                HttpClientInitializer = credential,
                ApplicationName = "Tasks API Sample",


Send feedback about...