Skip to content

LocalでApplication Default Credentialsを利用している時にG Suite APIやFirebase APIを実行するとgoogleapi: Error 403: Request had insufficient authentication scopes. になる #124

@sinmetal

Description

@sinmetal

WHAT

Google SpreadsheetなどのG Suite系のAPIやFirebase APIをApplicationから実行しようとした時に、Application Default Credentialsを利用していると権限があるにも関わらず403でエラーになる。

Refs

WHY

gcloud auth application-default login の場合、GCPのScopeは最強のもので取得しているけど、その中にG SuiteやFirebaseは含まれていないからっぽい?

Solution

gcloud auth application-default login --scopes を利用して必要な任意のScopeを設定してやる。

Spreadsheetだと gcloud auth application-default login --scopes "https://www.googleapis.com/auth/spreadsheets" みたいな感じ

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions