Newer Version Available
sfdxurl Commands
auth:sfdxurl:store
Help for auth:sfdxurl:store
The SFDX auth URL must have the format "force://<clientId>:<clientSecret>:<refreshToken>@<instanceUrl>". NOTE: The SFDX auth URL uses the "force" protocol, and not "http" or "https". Also, the "instanceUrl" inside the SFDX auth URL doesn't include the protocol ("https://").
You have three options when creating the auth file. The easiest option is to redirect the output of the `sfdx force:org:display --verbose --json` command into a file. For example, using an org you have already authorized:
1$ sfdx force:org:display -u <OrgUsername> --verbose --json > authFile.json1$ sfdx auth:sfdxurl:store -f authFile.jsonThe resulting JSON file contains the URL in the sfdxAuthUrl property inside of a results object. NOTE: The `force:org:display --verbose` command displays the refresh token only for orgs authorized with the web server flow, and not the JWT bearer flow.
You can also create a JSON file that has a top-level property named sfdxAuthUrl whose value is the auth URL. Finally, you can create a normal text file that includes just the URL and nothing else.
Examples for auth:sfdxurl:store
sfdx auth:sfdxurl:store -f <path to sfdxAuthUrl file>
sfdx auth:sfdxurl:store -f <path to sfdxAuthUrl file> -s -a MyDefaultOrg
Command Syntax
- sfdx auth:sfdxurl:store
- [--json]
- [--loglevel LOGLEVEL]
- -f SFDXURLFILE
- [-d]
- [-s]
- [-a SETALIAS]
Parameters
- --json
- Optional
-
Format output as JSON.
- Type: boolean
- --loglevel LOGLEVEL
- Optional
-
The logging level for this command invocation. Logs are stored in $HOME/.sfdx/sfdx.log.
- Type: enum
- Permissible values are: trace, debug, info, warn, error, fatal, TRACE, DEBUG, INFO, WARN, ERROR, FATAL
- Default value: warn
- -f | --sfdxurlfile SFDXURLFILE
- Required
-
Path to a file containing the sfdx url.
- Type: filepath
- -d | --setdefaultdevhubusername
- Optional
-
Set the authenticated org as the default dev hub org for scratch org creation.
- Type: boolean
- -s | --setdefaultusername
- Optional
-
Set the authenticated org as the default username that all commands run against.
- Type: boolean
- -a | --setalias SETALIAS
- Optional
-
Set an alias for the authenticated org.
- Type: string
Aliases for auth:sfdxurl:store
1force:auth:sfdxurl:store