<p>以下是谷歌文档中的一些注释<a href="https://cloud.google.com/pubsub/troubleshooting#403" rel="noreferrer">Troubleshooting 403 (Forbidden) error</a>:</p>
<blockquote>
<p>If you get this error, do the following:</p>
<ul>
<li>Make sure you've enabled the Google Cloud Pub/Sub API in the Cloud Platform Console.</li>
<li>Make sure that the principal making the request has the required permissions on the relevant Google Cloud Pub/Sub resources,<br/>
especially if you are using Google Cloud Pub/Sub for cross-project<br/>
communication.</li>
<li>If you're using Dataflow, make sure that both @cloudservices.gserviceaccount.com and the Compute Engine<br/>
Service account -compute@developer.gserviceaccount.com<br/>
have the required permissions on the relevant Google Cloud Pub/Sub<br/>
resource. See Google Cloud Dataflow Security and Permissions for more
information.</li>
<li>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<br/>
@appspot.gserviceaccount.com.</li>
</ul>
</blockquote>