# org login access-token

Authorize an org using an existing Salesforce access token.

## Description for org login 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.

If you pipe the access token to the command (so stdin isn't an interactive terminal), the command reads the token from stdin and doesn't prompt to overwrite an existing file.

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.

## Aliases for org login access-token

`force:auth:accesstoken:store`

`auth:accesstoken:store`

## Flags

| Flag Name (Long)        | Flag Name (Short) | Description                                                                                                                                                                                                                                                                                                                                                                                                                      |
| ----------------------- | ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--alias`               | `-a`              | **Type:** Value<br><br>Alias for the org.                                                                                                                                                                                                                                                                                                                                                                                        |
| `--flags-dir`           | N/A               | **Type:** Value<br><br>Import flag values from a directory.                                                                                                                                                                                                                                                                                                                                                                      |
| `--instance-url`        | `-r`              | **Type:** Value<br>**Required**<br><br>URL of the instance that the org lives on.<br><br>If you specify an --instance-url value, this value overrides the sfdcLoginUrl value in your sfdx-project.json file.<br><br>To specify a My Domain URL, use the format "https://<MyDomainName>.my.salesforce.com".<br><br>To specify a sandbox, set --instance-url to "https://<MyDomainName>--<SandboxName>.sandbox.my.salesforce.com". |
| `--json`                | N/A               | **Type:** Boolean<br><br>Format output as json.                                                                                                                                                                                                                                                                                                                                                                                  |
| `--no-prompt`           | `-p`              | **Type:** Boolean<br><br>Don't prompt for confirmation.                                                                                                                                                                                                                                                                                                                                                                          |
| `--set-default`         | `-s`              | **Type:** Boolean<br><br>Set the authenticated org as the default that all org-related commands run against.                                                                                                                                                                                                                                                                                                                     |
| `--set-default-dev-hub` | `-d`              | **Type:** Boolean<br><br>Set the authenticated org as the default Dev Hub.                                                                                                                                                                                                                                                                                                                                                       |

## Examples for org login access-token

Authorize an org on <https://mycompany.my.salesforce.com>; the command prompts you for the access token:

```shell
sf org login access-token --instance-url https://mycompany.my.salesforce.com
```

Authorize the org without being prompted; you must have previously set the SF_ACCESS_TOKEN environment variable to the access token:

```shell
sf org login access-token --instance-url https://dev-hub.my.salesforce.com --no-prompt
```
