cli icon indicating copy to clipboard operation
cli copied to clipboard

Feature request: "--browser" flag for "cf login"

Open tlwr opened this issue 5 years ago • 5 comments

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 --browser which 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-browser which 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

tlwr avatar Feb 18 '20 10:02 tlwr

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

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

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

cf-gitbot avatar Feb 18 '20 10:02 cf-gitbot

Hey @tlwr!

Thanks for the feature request, it looks like the Fly ci is using https://github.com/skratchdot/open-golang to handle opening the url regardless of browser, we will investigate adding this in a future release :)!

Thanks! Jenna and the cf CLI team

JenGoldstrich avatar Feb 19 '20 18:02 JenGoldstrich

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed.

github-actions[bot] avatar Sep 27 '24 17:09 github-actions[bot]

Thank you for your patience regarding the issue you reported. We will be reviewing your ticket with our product team to assess its impact and potential next steps. Once we have their feedback, we will update you accordingly.

If you have any further questions or additional information to share in the meantime, please feel free to reach out.

a-b avatar Oct 01 '24 21:10 a-b

+1 for this. I opened a browser from a CLI once, so I can check that code, if that helps.

mauricebrinkmann avatar Oct 29 '25 13:10 mauricebrinkmann