4

I'm using Google Cloud Queue tasks in my project where I'm able to create tasks that are added to my Queue in a scheduled time, but when the tasks are executed it throws: Google PERMISSION_DENIED(7): HTTP status code 403. Error screenshot

I followed the guidance from Google Cloud Tasks documentation, but there is something missing with permissions. Guide

I'm using the createHttpTask function that they provide as example in the https://www.npmjs.com/package/@google-cloud/tasks library.

const task = {
    httpRequest: {
      headers: {
        "Content-Type": "application/json",
        Authorization: "Bearer 'xxx'"
      },
      httpMethod: "POST",
      url,
      body: Buffer.from(JSON.stringify(body)).toString("base64"),
      oidcToken: {
        serviceAccountEmail,
        audience: url
      }
    }
  };

As you can see I added the serviceAccount and the audience in the task request

I created a new service account with this roles: Service account

I also enable the Google Tasks API, and I have another service account with this permissions Default Google API Tasks service account: Google Task API service account

Is there any other permissions that I'm missing? Or am I missing a step?

Thanks a lot

Dharmaraj
  • 47,845
  • 8
  • 52
  • 84

0 Answers0