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

CF LOGIN -U -P Called From Script/Program Hangs on invalid credentials #1809

Open
1 task
chrpai opened this issue Oct 9, 2019 · 5 comments
Open
1 task

Comments

@chrpai
Copy link

chrpai commented Oct 9, 2019

Please fill out the issue checklist below and provide ALL the requested information.

  • [x ] I reviewed open and closed github issues that may be related to my problem.
  • [ x] I tried updating to the latest version of the CF CLI to see if it fixed my problem.
  • [X ] I attempted to run the command with CF_TRACE=1 to help debug the issue.
  • [X ] I am reporting a bug that others will be able to reproduce.
  • If this is an issue for the v7 beta release, I've read through the official docs and the release notes.

Describe the bug and the command you saw an issue with
I was performing the following command from a script:
cf login -a "url" -u "username" -p "password" -o "org" -s "space"

I intentionally passed an incorrect username/password to test that scenario.

What happened
CF responded "Credentials were rejected, please try again." and then prompted for Password>

Expected behavior
Because -u and -p was passed I expect the program to terminate with an error exit code.

To Reproduce
Steps to reproduce the behavior; include the exact CLI commands and verbose output:
run cf login like shown above but use a valid URL for your environment.

Provide more context

  • Windows CMD prompt / C# Process.Start()
  • 6.46.1+4934877ec.2019-08-23
  • version of the CC API Release you are on Unknown

Note: As of January 2019, we no longer support API versions older than CF Release v284/CF Deployment v1.7.0 (CAPI Release: 1.46.0 (APIs 2.100.0 and 3.35.0).

Note: In order to complete the v7 beta cf CLI in a timely matter, we develop and test against the latest CAPI release candidate. When v7 cf CLI is generally available, we will start supporting official CC API releases again.

@cf-gitbot
Copy link

We have created an issue in Pivotal Tracker to manage this:

https://www.pivotaltracker.com/story/show/169048031

The labels on this github issue will be updated when the story is started.

@abbyachau
Copy link
Contributor

Related: #1112 (comment)

@abbyachau
Copy link
Contributor

Hi @chrpai thanks for creating this issue. For scripting purposes, have you tried using cf auth instead? That command does not prompt interactively and is thus more optimal for scripting purposes.

@chrpai
Copy link
Author

chrpai commented Oct 10, 2019

It does appear cf auth behaves better. But now I'd have to do an api, auth and target command where login does it all in one shot. I'd assume that all of cf is good for scripting?

@abbyachau
Copy link
Contributor

cf auth does require you to be more explicit: you'll need to target (this won't be required if you have already set your target previously) and set orgs and spaces separately. We could consider adding flags to that command but we won't be able to take on that work in the near future.

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

No branches or pull requests

3 participants