cloudfoundry / cloudfoundry/cli
Feature request: "--browser" flag for "cf login"
@a-b is already working on this.
Since Oct 1, 2024.
- Dominant language
- Go
- Stars
- 1.9k
- Forks
- 990
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 8
Description
Context
Single sign-on flow is fragile depending on terminal emulator used by user.
Some users, running cf login --sso are given a link, which is copy-and-pasteable into a web browser; more commonly, users use their terminal emulator to click the link. This link can sometimes be truncated to domain.suffix/pa or passcod, etc due to line-wrapping, or other issues.
These problems are to do with the terminal emulator, and so are not fixable by CF CLI, however the CLI could provide more ergonomic ways for getting a passcode.
Concourse's CLI fly has a --browser / -b flag which performs the flow automatically, by opening the browser which, in turn, redirects the user to a local port. This may be overkill however.
I propose either implementing the --browser flag via Fly, or alternatively provider an --open-browser flag which opens the passcode URL, obviating the need for a user to copy/paste the link.
The --sso-passcode flag is useful, but does not solve the problem described.
What's the user value of this feature request?
Operators of Cloud Foundry would be able to document a less fragile way of signing in, either by using the --browser flow or the --open-browser flag to automatically link users to the correct page.
Who is the functionality for?
This could be used by any user who uses single sign-on to log in.
How often will this functionality be used by the user?
Whenever the user logs in.
Who else is affected by the change?
This would be a non-breaking change
Is your feature request related to a problem? Please describe.
Users semi-regularly report that SSO is not working, because their terminal emulator does not play nicely with CF CLI output.
Describe the solution you'd like
One of, depending on preferences of product management:
As a user, I want to be able to run
cf login --sso --browserwhich automatically conducts the browser login flow, with a local redirection, so that I don't have to copy and paste.
As a user, I want to be able to run
cf login --sso --open-browserwhich automatically opens the passcode page in my browser, so that copy-and-pasting the link is more ergonomic, and less fragile
Describe alternatives you've considered
Writing a CF Plugin instead
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.