How to get Salesforce Sfdx Auth Url

1. Install SFDX

Refs: https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup/sfdx_setup_install_cli.htm

The easiest way is to install via npm:

npm install sfdx-cli --global

To check if the sfdx is installed or not:

sfdx --version

2. Authorize an org with the OAuth 2.0 webserver

In this step, you will need to login via a web browser to authorize the CLI application.

sfdx force:auth:web:login -r <login_url>

If the command hangs up too long, you can try the alternative way:

sfdx force:auth:device:login -r <login_url>

The login Url for the corresponding environment:

Environment Url
Production https://login.salesforce.com
Development https://login.salesforce.com
Sandbox https://test.salesforce.com
Pre-release https://prerellogin.salesforce.com

3. Get the Sfdx Auth Url

sfdx force:org:display --targetusername <your_user_name> --verbose

Example of result:

sfdx auth url example magenaut blog

Depends on the environment, the Url will be used as:

  • DEVHUB_AUTH_URL
  • SANDBOX_AUTH_URL
  • PRODUCTION_AUTH_URL

That’s all, please leave a comment if you have any question, I’ll reply as soon as I can.

 

5 1 vote
Article Rating
Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x