cli icon indicating copy to clipboard operation
cli copied to clipboard

Support targeting specific browsers for force:auth:web:login

Open mike-wannamaker-gs opened this issue 3 years ago • 2 comments

Is your feature request related to a problem? Please describe. Similarly to this feature request: https://github.com/forcedotcom/cli/issues/1015 but for the force:auth:web:login command.

What are you trying to do Would be good to be able to support being able to choose the browser application to use when opening an org with force:auth:web:login

Describe the solution you'd like Option just like: https://github.com/forcedotcom/cli/issues/1015

mike-wannamaker-gs avatar Apr 04 '22 13:04 mike-wannamaker-gs

Thank you for filing this feature request. We appreciate your feedback and will review the feature at our next grooming or sprint planning session. We prioritize feature requests with more upvotes and comments.

github-actions[bot] avatar Apr 04 '22 13:04 github-actions[bot]

This issue has not received a response in 60 days. It will auto-close in 7 days unless a response is posted.

github-actions[bot] avatar Sep 21 '22 19:09 github-actions[bot]

Marking this as help wanted, if anyone is interested in adding this feature take a look at this PR which added the required flag to the force:org:open command, it should be mostly copying what's there to the auth command: https://github.com/salesforcecli/plugin-org/pull/211

force:auth:web:login code where this should be added: https://github.com/salesforcecli/plugin-auth/blob/main/src/commands/auth/web/login.ts#L105

post here if you have any questions

cristiand391 avatar Nov 08 '22 15:11 cristiand391

Whoops, will close when this is released in stable next week.

RodEsp avatar Nov 30 '22 22:11 RodEsp

@mshanemc what is the actual resolution of this? Are there new command-line options that I should supply when invoking force:auth:web:login in IC2 based on the IDE's browser preference?

SCWells72 avatar Dec 12 '22 14:12 SCWells72

@SCWells72 you can target a specific browser in latest sfdx v.7.180.0 using the new --browser flag, see rel notes: https://github.com/forcedotcom/cli/tree/main/releasenotes/sfdx#71800-dec-8-2022-stable

It the flag is not specified, force:auth:web:login will still open the default browser.

cristiand391 avatar Dec 12 '22 15:12 cristiand391

It would be REALLY cool if there was an option to open in an incognito window as well. Would that be doable at all?

lekkimworld avatar Dec 14 '22 09:12 lekkimworld

@lekkimworld we use the open npm pkg to open browsers from the CLI.

Some examples show how to open an incognito window in chrome: https://github.com/sindresorhus/open#usage

but that doesn't work on all platforms. There's an open request to add a cross-platform solution: https://github.com/sindresorhus/open/issues/266

I would prefer to wait until a cross-platform solution is added to open rather than implement it in our CLI 👍🏼

cristiand391 avatar Dec 14 '22 12:12 cristiand391

Also, oauth via an incognito window doesn't work--it'll log in, but the tokens don't come back to the CLI. Probably something to do with how incognito is intentionally isolating identity items.

mshanemc avatar Dec 14 '22 14:12 mshanemc