---
title: "The edge login command"
slug: "the-edge-login-command"
abstract: "Reference for the Sitecore CLI edge login command for authenticating within an Experience Edge organization."
---
# The edge login command

The Experience Edge plugin for Sitecore CLI provides the `edge login` command that authenticates you within an organization.

<details>
<summary><h2>Usage</h2></summary>

You can use the `edge login` command as follows:

```shell
dotnet sitecore edge login [options]

```

Running the `login` command without options initializes an interactive/device authorization login flow for authenticating with an organization. For example:

```shell
dotnet sitecore edge login

```

> [!note]
> This command requires that you [obtain a tenant ID from a list of tenants](https://doc.sitecore.com/xp/en/developers/104/developer-tools/the-edge-tenant-command.html#UUID-a28c03a4-5aa3-b5cc-9e7a-4c76bb1fc5c6_section-idm1401675786552821 "The list subcommand") and [select a specific Edge tenant for subsequent commands](https://doc.sitecore.com/xp/en/developers/104/developer-tools/the-edge-tenant-command.html#UUID-a28c03a4-5aa3-b5cc-9e7a-4c76bb1fc5c6_section-idm1406703146211278 "The use subcommand").

You can also log directly into a production environment for a specific tenant if you have the necessary credentials. For example:

```shell
dotnet sitecore edge login --clientId <your-client-ID> --clientSecret <your-client-secret>

```

</details>

<details>
<summary><h2>Options</h2></summary>

The Experience Edge `login` command has the following options:

| Option | Description |
| --- | --- |
| `--clientId`, `--id` | Specifies the client ID used to log in to the specific Edge tenant.<br><br>Required for non-interactive/client credentials login. |
| `--clientSecret`, `--secret` | Specifies the client secret used to log in to the specific Edge tenant.<br><br>Required for non-interactive/client credentials login. |
| `--aud, --audience` | Specifies the custom audience. This might be useful for the older Edge tenants (provisioned with the Provisioning API v1). |
| `--env`, `--environment` | Specifies the Experience Edge environment to target.<br><br>Possible values: `preprod`, `prod`<br><br>Default: `prod` |
| `-?`, `-h`, `--help` | Displays developer help and usage information about the command |

> [!note]
> Any Experience Edge command memorizes the last used environment option. On subsequent commands for the same Edge environment, you can omit the `--env` option.
>
> You obtain the client credentials as follows:
>
> -   For Sitecore XM/XP on-prem - Sitecore provides you with the credentials.
>
> -   For [](https://doc.sitecore.com/sai/en/users/sitecoreai/sitecoreai.html)\- [create an Edge administration client](https://doc.sitecore.com/xmc/en/developers/xm-cloud/en/manage-client-credentials-for-a-sitecoreai-organization-or-environment.html#UUID-920cbb42-c34a-43e9-d69a-fe81e3314424_section-idm1733356539496462).

</details>