SalesforceDX: Log in to sandbox by username/password from command line without browser involved

Is it possible to log in from sfdx CLI to already existent sandbox having username/password combination?

Reading through documentation I see bunch of ways how to authorize – through browser, by providing JWT token and consumer key, using existent access token etc. But cannot find a simple way how to do it in a browserless way just by providing username & password right in command line.

We just need to deploy code and run tests against our qa sandbox from CI pipeline – need to authorize an org somehow without human being involved. Is there a simpler way than following whole JWT authorization flow, i.e. creating connected app on each sandbox, upload certificate etc.

Any help would be appreciated.

Answer

You could use the auth command from the sfpowerkit plugin:

sfpowerkit auth:login

https://github.com/Accenture/sfpowerkit

It supports login with username-password combination (probably will need security token as well). A functionality that the standard CLI lacks

Attribution
Source : Link , Question Author : wesaw , Answer Author : jonathanwiesel

Leave a Comment