LoginSignup
2
1

More than 1 year has passed since last update.

GCP gcloud auth application-default login ができない

Posted at

環境

macOS Monterey 12.0.1

はじめに

下記問題に対する解決法を書きましたが、同エラーに対する原因は場合によって違うと思われます。
ここではそのなかで自分が突破した方法のみご紹介します。

問題

下記コマンドでGCPの認証を得ようとしたがエラーが返る。

gcloud auth application-default login

以下エラー内容

ERROR: (gcloud.auth.application-default.login) UNAUTHENTICATED: Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.
- '@type': type.googleapis.com/google.rpc.ErrorInfo
  domain: googleapis.com
  metadata:
    method: google.cloudresourcemanager.v1.Projects.[Test]
    service: cloudresourcemanager.googleapis.com
  reason: CREDENTIALS_MISSING

解決方法

認証を使用する設定に変える。

gcloud config set auth/disable_credentials false

確認

$ gcloud config list
〜
[auth]
disable_credentials = false

原因

認証を使用する設定になっていなかった。

$ gcloud config list
〜
[auth]
disable_credentials = true

背景

Cloud Spanner のドキュメントを手を動かしながら進めようとしてこうなりました。
GCP 使いこなせるようになりたい。

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1