Support targeting specific browsers for force:auth:web:login
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
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.
This issue has not received a response in 60 days. It will auto-close in 7 days unless a response is posted.
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
Whoops, will close when this is released in stable next week.
@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 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.
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 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 👍🏼
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.