infisical icon indicating copy to clipboard operation
infisical copied to clipboard

Login redirect from CLI to browser

Open vmatsiiako opened this issue 2 years ago • 2 comments

Feature description

When I need to log in in the CLI, it would be really awesome to be redirected to the browser. Then I can really easily login with 1password Chrome extension or the Apple Keychain, and I don't need to paste my password to the CLI.

Why would it be useful?

This would save a lot of time, reduce friction, and improve general experience of using Infisical

vmatsiiako avatar Feb 17 '23 00:02 vmatsiiako

Hey @mv-turtle, this seems like a good issue to work on. Although I haven't worked on golang extensively as I could gather from the codebase, I believe we need to write a condition where we give the user to log in via the browser and then it redirects to the browser. And we do this in packages/cmd/login.go?

If this sounds good, I would like to work on it, can you assign it to me?

animeshdas2000 avatar Feb 17 '23 10:02 animeshdas2000

@animeshdas2000 yes, this should be done in packages/cmd/login.go. What you want to do is pop open the browser from the CLI, and have the CLI listen to a call back (usually on a port). When the user completes a login in the browser, send over the private key, public key, JWT token, and any other info you see needed in login cmd. The rest of the workflow should be to save the details to keyring like we already do.

By the way, I am making some changes in packages/cmd/login.go so let me push out these changes before you have a large merge conflict. Feel free to explore though and let me know what your approach is.

maidul98 avatar Feb 17 '23 15:02 maidul98

Hey @animeshdas2000 just checking in. Let us know if you need a bit of help!

maidul98 avatar Mar 05 '23 14:03 maidul98

Hey @maidul98, I am on it. Was stuck due to some personal commitment but I'm back and I should be able to raise a PR soon. I'll reach out in case I'm stuck. Thanks for checking on this

animeshdas2000 avatar Mar 05 '23 15:03 animeshdas2000

This has been released in our recent release. Thus closing it for now, feel free to create a new issue if its not working.

akhilmhdh avatar Jul 05 '23 17:07 akhilmhdh