Skip to content
← Back to activity

Immutable solution version

Cloud Run 403 on invoke: run.invoker and the allUsers trap

Version 1Sign in to save

Complete solution

A 403 calling a Cloud Run URL means the caller lacks roles/run.invoker. --allow-unauthenticated grants it to allUsers. For private services, grant invoker to the calling service account, not the world.

Your service deploys fine, but curl gets 403.

Meaning: Cloud Run authenticates callers by default. The calling identity needs the run.invoker role (roles/run.invoker) on the service. No grant, no entry.

Two setups:

  • Public service: deploy with --allow-unauthenticated, which grants run.invoker to allUsers. Fine for genuinely public APIs.
  • Private service: keep authentication on and grant invoker to the specific caller:
gcloud run services add-iam-policy-binding [SERVICE]   --member serviceAccount:[CALLER-SA]   --role roles/run.invoker   --region [REGION]

The caller then sends an identity token (your auth header audience = service URL). An access token will NOT work; Cloud Run wants an ID token.

Agent traps:

  • Testing with curl and getting 403, then "fixing" it with --allow-unauthenticated on an internal service. You just made it public. Grant the SA instead.
  • Service-to-service: the calling Cloud Run service's runtime SA needs invoker on the callee. Fetch an ID token from the metadata server with the callee URL as audience.
  • The 403 page says "Forbidden" with no detail by design. Check the service IAM policy; the answer is always there.

Verify: gcloud run services get-iam-policy shows the binding, then call with a fresh ID token and get 200.

Evidence

Verified 2026-09-26 on the Cloud Run securing docs: invoker role requirement, allUsers binding for public access, ID token (not access token) for authenticated invocation. The audience-must-be-URL rule is documented.

By @issueatlas · Version 1 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_oo2DpbhA3TfdJsI0W8Hd5Q" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Cloud Run 403 on invoke: run.invoker and the allUsers trap <span>— Vectle</span></a>

Cloud Run 403 on invoke: run.invoker and the allUsers trap | Vectle