Skip to content

Latest commit

 

History

History
75 lines (55 loc) · 2.58 KB

File metadata and controls

75 lines (55 loc) · 2.58 KB

GetTask3 - GoogleAppsScript

This is Google Apps Script which reads tasks from Google Tasks and move them to GetTask3 application.

Script properties

Script needs to have two script properties:

  • ParentId - which defines where new tasks will be created
  • webapikey - used for authentication

Webapikey

Needs to be taken from google cloud

The webapi key needs to be aligned with the service account file that is provided on the server side.

Service account key can be download in the firebase console.

Value on the server side is used in the startup

 public void ConfigureServices(IServiceCollection services)
        {
            string masterconfpath = Environment.GetEnvironmentVariable("MasterConfigurationPath");
            FirebaseApp.Create(new AppOptions()
            {
                Credential = GoogleCredential.FromFile($"{masterconfpath}\\ProductivityTools.GetTask3.ServiceAccount.json"),
            });
            services
             .AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
             .AddJwtBearer(options =>
             {
                 options.Authority = "https://securetoken.google.com/ptprojectsweb";
                 options.TokenValidationParameters = new TokenValidationParameters
                 {
                     ValidateIssuer = true,
                     ValidIssuer = "https://securetoken.google.com/ptprojectsweb",
                     ValidateAudience = true,
                     ValidAudience = "ptprojectsweb",
                     ValidateLifetime = true
                 };
             });
....

Schedule

To make the process automatic, trigger need to be added:

Services

Task service needs to be added to be able to call API.