Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected 0 return code from echo "" | gcloud auth application-default print-access-token when unauthenticated #11

Closed
jamesbraza opened this issue Mar 14, 2024 · 2 comments

Comments

@jamesbraza
Copy link

I am trying to suppress the password prompt for gcloud auth application-default print-access-token. When piping echo "" into that command, I expect:

  • The password prompt to be suppressed
  • A nonzero return code, as the authentication failed (empty password)

In actuality, it suppresses the password prompt, but it gives a 0 return code. I think this is a bug, it should have a nonzero return code because it's a failed authentication.

> gcloud auth application-default print-access-token
Reauthentication required.
Please enter your password:

Command killed by keyboard interrupt


> echo $?
130
> echo "" | gcloud auth application-default print-access-token

> echo $?
0

I have the below version on macOS Sonoma version 14.3:

> gcloud --version
Google Cloud SDK 468.0.0
bq 2.0.101
core 2024.03.08
gcloud-crc32c 1.0.0
gsutil 5.27
@twistedpair
Copy link
Owner

This is a mirror repo. It is not the location for reporting gcloud bugs.

To report gcloud bugs, please see the official bug tracker.

@jamesbraza
Copy link
Author

Thank you @twistedpair sorry for opening this in the wrong place. I have made https://issuetracker.google.com/issues/355182139

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants