The cloud login command

The Sitecore XM Cloud plugin provides the cloud login command. The command authenticates a person through the Sitecore CLI with an XM Cloud Organization, granting them access tokens and claims based on authorization.

Initial credentials and endpoints are stored in the Sitecore.DevEx.Extensibility.XMCloud<version>\plugin\plugin.json file. After logging in, you can find them in the .sitecore\user.json file.

Usage

You can use the cloud login command as follows:

RequestResponseshell
dotnet sitecore cloud login [options] 

You can run the command without any options.

To log in to a Sitecore XM Cloud Organization, the Sitecore CLI XM Cloud plugin allows two flows of authentication and authorization:

  • An interactive user login using a device code flow.

  • A non-interactive client login using a client credentials flow. This is used by clients such as Continuous Integration (CI) servers.

For interactive user login using a device code authentication flow, use the command:

RequestResponseshell
dotnet sitecore cloud login

For non-interactive client logins using client credential flows, use the command:

RequestResponseshell
dotnet sitecore cloud login --client-credentials --client-id <clientId> --client-secret <clientSecret>

Options

The cloud login command has the following options:

Option

Description

--authority, --auth

Specifies the Identity Server used to authenticate to the Sitecore Cloud system and Organization.

Default: the value set with the XM Cloud SaaS Identity auth URL.

--audience

Specifies the audience for authentication to the Sitecore Cloud system and Organization. In production, provide one of the following audiences:

  • To access the XM Cloud environment, https://api.sitecorecloud.io.

  • To access the Sitecore deployment using the XM Cloud DevEx plugin, https://xmcloud-cm.sitecorecloud.io.

--client-id

Specifies the client ID used for the Sitecore Cloud system and Organization authentication.

--client-secret

Specifies the client secret used for authentication to the Sitecore Cloud system and Organization.

--client-credentials

A Boolean parameter specifying whether to use the client credentials flow. Use it for authentication flows with continuous integration and automation tools.

--xmcloudhost

Specifies the XM Cloud hosting URL.

--config

Path to the sitecore.json file. Default: the root directory of the Sitecore project solution.

--verbose, -v

Write additional information about the command.

--trace, -t

Write diagnostics and detailed information about the command.

-?, -h, --help

Display developer help and usage information about the command.

Do you have some feedback for us?

If you have suggestions for improving this article,