Hi community, I’m currently trying to integrate a Google Cloud Function with my Bubble.io application, but I’m encountering a 401 Unauthorized error when attempting to invoke the Cloud Function.
Current Setup:
- Cloud Function:
- Deployed via Google Cloud Functions.
- The function is accessible via the URL:
https://us-central1-esghgprototype.cloudfunctions.net/function-1
. - I have set the function’s permissions to allow all users (using the
Cloud Functions Invoker
role) to call the function.
- Permissions:
- The service account used to call the Cloud Function has the Cloud Functions Invoker role attached.
- The function is set to be publicly accessible, and permissions have been verified for the service account as well.
- Authentication:
- The API call is being made from a Bubble.io API Connector using the Google service account’s JSON key for authentication.
- The key has been correctly configured in the API Connector, and I’m using the appropriate Authorization header with the Bearer token.
- I’ve ensured that the function’s permissions are configured correctly, and the service account has the correct roles.
- Current Behavior:
- The API call returns a 401 Unauthorized error with the message: “Your client does not have permission to the requested URL /function-1”.
- When manually visiting the Cloud Function URL in the browser, I see the error: “Error: Forbidden. Your client does not have permission to get URL /function-1 from this server.”
What I’ve Tried:
- Ensured the Cloud Function is publicly accessible with correct permissions (
Cloud Functions Invoker
). - Double-checked the URL and endpoint.
- Tried re-deploying the Cloud Function.
- Verified the service account and permissions.
- Checked Google Cloud Logs for errors.