Cloud Functions Authenticate

Hey folks,

I'm trying to do a simple API call to a Cloud Function but I'm having a lot of trouble to correctly authenticate. The reason I know authentication is the problem is because when I set the Cloud Function to public it works well.

This is my Cloud Function:

const functions = require('@google-cloud/functions-framework');

functions.http('helloJson', (req, res) => {
  const message = { message: 'Hello, World!' };
  res.status(200).json(message);
});

This is my API Call setup:

And this is the permissions setup:

I also deployed -via FF- the required Cloud Function for secure API Call.

My ultimate goal is to connect to other google API's that require authentication, Google Vision in particular.

Would highly appreciate your help and guidance.

Regards

2
1 reply