Newer Version Available

This content describes an older version of this product. View Latest

Authorize in to Your Production Org

Right now, to run the sandbox operations commands, we support only the JWT-based flow for authorizing to your production org. This flow requires a production org with sandbox licenses instead of a Dev Hub. However, it’s okay if your production org is also a Dev Hub org.

If you authenticated to your production org already using the web-based flow, you must authenticate again using the JWT-based flow to use the sandbox operations CLI commands.

Important

The examples in Authorize an Org Using the JWT-Based Flow are geared toward scratch orgs. Follow these tips to successfully authorize to your production org.
  • Be sure to use https://login.salesforce.com for sfdcLoginUrl in sfdx-project.json file. Alternatively, you can use force:auth:jwt:grant --instanceurl to specify the URL directly on the command line. This value overrides the login URL you specified in the sfdx-project.json file.
  • Specify the username for your production org when running the force:auth:jwt:grant command. No need to specify a Dev Hub or indicate a default Dev Hub.
  • The JWT authorization flow requires that you create a connected app. When you create the connected app, log in to your production org, not a Dev Hub org.