Login to Sandbox
This command logs in to a specified sandbox org using the authentication details of the user who requested the creation of sandbox
Usage
$ sfp sandbox:login -n <string> [flags]
$ sfp org:login:sandbox -n <string> [flags]Flags
| Flag | Required | Description |
|---|---|---|
-n, --name=<value> | Yes | Name of the sandbox to log in to (max 10 characters) |
-p, --production-username=<value> | No | Username of the production org that owns the sandbox (through sfp server) |
-v, --targetdevhubusername=<value> | No | Username or alias of the production org (without sfp server) |
-a, --alias=<value> | No | Alias to set for the authenticated sandbox org |
-s, --set-default | No | Set the sandbox as the default org |
-w, --write-file | No | Write login details to a file (org-info.json) |
--sfp-server-url=<value> | No | URL of sfp server |
--json | No | Format output as JSON |
--loglevel=<option> | No | Logging level for this command invocation |
The full flag list is in the CLI reference.
Examples
$ sfp sandbox:login --name mySandbox1 -v myDevHub
$ sfp sandbox:login --name mySandbox1 -v myDevHub --alias mySandboxAlias --write-file
$ sfp sandbox:login --name dev1 --production-username admin@prod.com --alias dev1Logging in through sfp server
When an sfp server is configured (--sfp-server-url, SFP_SERVER_URL or sfp config:set server-url) and you are logged in to it, the command asks the server for the sandbox session. The server authenticates through a production org registered with it: the one named by -p, or the one it finds by searching its registered production orgs.
What the server allows depends on your role:
| Sandbox | Member | Owner | Application token |
|---|---|---|---|
| A dev or review sandbox from a sandbox pool | Yes | Yes | Yes |
| Any other sandbox, registered or not | No | Yes | Yes |
A member who asks for any other sandbox is refused with Only owners can log in to sandboxes outside pools through codev. The refusal comes before the server contacts Salesforce.
The local login holds an access token only, with no refresh token. It expires after about two hours; run the command again to reconnect.