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:

EnvironmentUrl
Productionhttps://login.salesforce.com
Developmenthttps://login.salesforce.com
Sandboxhttps://test.salesforce.com
Pre-releasehttps://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 found this post helpful, thanks!

 

0 0 vote
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments