Difference between revisions of "Gcloud auth application-default login"
Jump to navigation
Jump to search
(10 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{lc}} | {{lc}} | ||
+ | |||
+ | [[gcloud auth application-default]] login | ||
+ | Your browser has been opened to visit: | ||
+ | |||
+ | https://accounts.google.com/o/oauth2/auth?response_type=.../... | ||
+ | |||
+ | |||
+ | Credentials saved to file: [/Users/user/[[.config/]]gcloud/application_default_credentials.json] | ||
+ | |||
+ | These credentials will be used by any library that requests [[Application Default Credentials]] ([[ADC]]). | ||
+ | WARNING: | ||
+ | Cannot find a quota project to add to ADC. You might receive a "quota exceeded" or "API not enabled" error. Run $ gcloud auth application-default set-quota-project to add a quota project. | ||
+ | |||
+ | |||
[[gcloud auth]] application-default login | [[gcloud auth]] application-default login | ||
Line 5: | Line 19: | ||
[/Users/YOUR_USER/your_path/your-gcloud-auth-file.json] | [/Users/YOUR_USER/your_path/your-gcloud-auth-file.json] | ||
Credentials will still be generated to the default location: | Credentials will still be generated to the default location: | ||
− | [/Users/YOUR_USER/[[.config/]]gcloud/application_default_credentials.json] | + | [/Users/YOUR_USER/[[.config/]]gcloud/[[application_default_credentials.json]]] |
To use these credentials, unset this environment variable before | To use these credentials, unset this environment variable before | ||
running your application. | running your application. | ||
Do you want to continue (Y/n)? | Do you want to continue (Y/n)? | ||
+ | |||
+ | <pre> | ||
+ | ╷ | ||
+ | │ Error: Attempted to load application default credentials since neither `credentials` nor `access_token` was set in the provider block. No credentials loaded. To use your gcloud credentials, run 'gcloud auth application-default login' | ||
+ | │ | ||
+ | │ with provider["registry.terraform.io/hashicorp/google"], | ||
+ | │ on vpc.tf line 12, in provider "google": | ||
+ | │ 12: provider "google" { | ||
+ | │ | ||
+ | │ google: could not find default credentials. See https://cloud.google.com/docs/authentication/external/set-up-adc for more information | ||
+ | </pre> | ||
Line 15: | Line 40: | ||
== Related == | == Related == | ||
+ | * <code>[[gcloud auth login]]</code> | ||
+ | * <code>[[gcloud init]]</code> | ||
[[curl]] \ | [[curl]] \ | ||
[[-H]] "Authorization: Bearer "$(gcloud auth application-default print-access-token) \ | [[-H]] "Authorization: Bearer "$(gcloud auth application-default print-access-token) \ | ||
-H "Content-Type: application/json; charset=utf-8" \ | -H "Content-Type: application/json; charset=utf-8" \ | ||
https://analyticsadmin.googleapis.com/v1alpha/accounts | https://analyticsadmin.googleapis.com/v1alpha/accounts | ||
− | + | * [[Terraform GKE]] | |
== See also == | == See also == | ||
* {{gcloud auth}} | * {{gcloud auth}} | ||
− | * {{gcloud}} | + | * {{gcloud init}} |
[[Category:GCP]] | [[Category:GCP]] |
Latest revision as of 20:36, 4 December 2023
gcloud auth application-default login Your browser has been opened to visit: https://accounts.google.com/o/oauth2/auth?response_type=.../... Credentials saved to file: [/Users/user/.config/gcloud/application_default_credentials.json] These credentials will be used by any library that requests Application Default Credentials (ADC). WARNING: Cannot find a quota project to add to ADC. You might receive a "quota exceeded" or "API not enabled" error. Run $ gcloud auth application-default set-quota-project to add a quota project.
gcloud auth application-default login The environment variable [GOOGLE_APPLICATION_CREDENTIALS] is set to: [/Users/YOUR_USER/your_path/your-gcloud-auth-file.json] Credentials will still be generated to the default location: [/Users/YOUR_USER/.config/gcloud/application_default_credentials.json] To use these credentials, unset this environment variable before running your application. Do you want to continue (Y/n)?
╷ │ Error: Attempted to load application default credentials since neither `credentials` nor `access_token` was set in the provider block. No credentials loaded. To use your gcloud credentials, run 'gcloud auth application-default login' │ │ with provider["registry.terraform.io/hashicorp/google"], │ on vpc.tf line 12, in provider "google": │ 12: provider "google" { │ │ google: could not find default credentials. See https://cloud.google.com/docs/authentication/external/set-up-adc for more information
Related[edit]
curl \ -H "Authorization: Bearer "$(gcloud auth application-default print-access-token) \ -H "Content-Type: application/json; charset=utf-8" \ https://analyticsadmin.googleapis.com/v1alpha/accounts
See also[edit]
Advertising: