org login access-token
Authorize an org using an existing Salesforce access token.
By default, the command runs interactively and asks you for the access token. If you previously authorized the org, the command prompts whether you want to overwrite the local file. Specify –no-prompt to not be prompted.
To use the command in a CI/CD script, set the SF_ACCESS_TOKEN environment variable to the access token. Then run the command with the –no-prompt parameter.
force:auth:accesstoken:store
auth:accesstoken:store
| Flag Name (Long) | Flag Name (Short) | Description |
|---|---|---|
‑‑alias | ‑a | Type: Value Alias for the org. |
‑‑flags‑dir | N/A | Type: Value Import flag values from a directory. |
‑‑instance‑url | ‑r | Type: Value Required URL of the instance that the org lives on. If you specify an –instance-url value, this value overrides the sfdcLoginUrl value in your sfdx-project.json file. To specify a My Domain URL, use the format “https://<MyDomainName>.my.salesforce.com”. To specify a sandbox, set –instance-url to “https://<MyDomainName>–<SandboxName>.sandbox.my.salesforce.com”. |
‑‑json | N/A | Type: Boolean Format output as json. |
‑‑no‑prompt | ‑p | Type: Boolean Don’t prompt for confirmation. |
‑‑set‑default | ‑s | Type: Boolean Set the authenticated org as the default that all org-related commands run against. |
‑‑set‑default‑dev‑hub | ‑d | Type: Boolean Set the authenticated org as the default Dev Hub. |
Authorize an org on https://mycompany.my.salesforce.com; the command prompts you for the access token:
Authorize the org without being prompted; you must have previously set the SF_ACCESS_TOKEN environment variable to the access token: