Here are some notes come from google's documentation Troubleshooting 403 (Forbidden) error :
If you get this error, do the following:
- Make sure you've enabled the Google Cloud Pub/Sub API in the Cloud Platform Console.
- Make sure that the principal making the request has the required permissions on the relevant Google Cloud Pub/Sub resources,
especially if you are using Google Cloud Pub/Sub for cross-project
communication.
- If you're using Dataflow, make sure that both @cloudservices.gserviceaccount.com and the Compute Engine
Service account [email protected]
have the required permissions on the relevant Google Cloud Pub/Sub
resource. See Google Cloud Dataflow Security and Permissions for more
information.
- If you're using App Engine, check your project's Permissions page to see if an App Engine Service Account listed as an Editor. If it
is not, add your App Engine Service Account as an Editor. Normally,
the App Engine Service Account is of the form
@appspot.gserviceaccount.com.