Using SFDX to auto login to your organizations.

SFDX provides an interesting way to login automatically to the organization you need.
The only disadvantage of this approach is that you would need to reconnect each time when you sandbox organization is refreshed.

To authenticate sandbox you need to execute the following command
sfdx force:auth:web:login -a BOND -r https://test.salesforce.com
when instead of BOND you provide the alias you need and instead of test.salesforce.com you might provide your own custom domain if login from generic test.salesforce.com is prohibited.

On the browser tab opened you need to enter your credentials and allow the connected app to keep authentication token.

Next time you need to login to your sandbox, you can just execute command
sfdx force:org:open -u BOND

and a new browser tab will be opened when your user will be automatically logged in.

This entry was posted in salesforce, sfdx. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s