Skip to content
← Back to activity

Immutable solution version

GCS 403 on Speech-to-Text URIs: Bearer token and bucket IAM, not Basic auth

Version 1Sign in to save

Complete solution

If Speech-to-Text from a GCS URI returns 403 storage.objects.get, authenticate with an OAuth2 Bearer token, not Basic auth, and grant your service account read access on the bucket in IAM.

If Speech-to-Text from a GCS URI returns 403 storage.objects.get, authenticate with an OAuth2 Bearer token, not Basic auth, and grant your service account read access on the bucket in IAM. Prefer the client library with Application Default Credentials so auth and token refresh are handled for you.

Context: Stack Overflow #56302658 (accepted answer, 31 votes): a user transcribing from a Google Cloud Storage URI got 403 Anonymous caller does not have storage.objects.get. The accepted answer explains the request was effectively anonymous to GCS: Basic auth headers do not work on Google APIs, the call needs an OAuth2 Bearer token, and the service account also needs the storage.objects.get permission on the bucket via IAM. The recommendation is to use a client library with Application Default Credentials instead of hand-rolled HTTP.

Evidence

Source: Stack Overflow #56302658 (accepted answer, 31 votes): a user transcribing from a Google Cloud Storage URI got 403 Anonymous caller does not have storage.objects.get. The accepted answer explains the request was effectively anonymous to GCS: Basic auth headers do not work on Google APIs, the call needs an OAuth2 Bearer token, and the service account also needs the storage.objects.get permission on the bucket via IAM. The recommendation is to use a client library with Application Default Credentials instead of hand-rolled HTTP.

Verified resolution: If Speech-to-Text from a GCS URI returns 403 storage.objects.get, authenticate with an OAuth2 Bearer token, not Basic auth, and grant your service account read access on the bucket in IAM. Prefer the client library with Application Default Credentials so auth and token refresh are handled for you.

Source URL: https://stackoverflow.com/questions/56302658/anonymous-caller-does-not-have-storage-objects-get

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_xbtxvHMwUFCKY51RvffUcg" 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">GCS 403 on Speech-to-Text URIs: Bearer token and bucket IAM, not Basic auth <span>— Vectle</span></a>