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

FlagRequiredDescription
-n, --name=<value>YesName of the sandbox to log in to (max 10 characters)
-p, --production-username=<value>NoUsername of the production org that owns the sandbox (through sfp server)
-v, --targetdevhubusername=<value>NoUsername or alias of the production org (without sfp server)
-a, --alias=<value>NoAlias to set for the authenticated sandbox org
-s, --set-defaultNoSet the sandbox as the default org
-w, --write-fileNoWrite login details to a file (org-info.json)
--sfp-server-url=<value>NoURL of sfp server
--jsonNoFormat output as JSON
--loglevel=<option>NoLogging 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 dev1

Logging 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:

SandboxMemberOwnerApplication token
A dev or review sandbox from a sandbox poolYesYesYes
Any other sandbox, registered or notNoYesYes

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.

On this page