The cloud login command
Reference for the Sitecore CLI cloud login command authenticating with an XM Cloud Organization.
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:
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:
dotnet sitecore cloud login
For non-interactive client logins using client credential flows, use the command:
dotnet sitecore cloud login --client-credentials --client-id <clientId> --client-secret <clientSecret>
Options
The cloud login
command has the following options:
Option |
Description |
---|---|
|
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. |
|
Specifies the audience for authentication to the Sitecore Cloud system and Organization. In production, provide one of the following audiences:
|
|
Specifies the client ID used for the Sitecore Cloud system and Organization authentication. |
|
Specifies the client secret used for authentication to the Sitecore Cloud system and Organization. |
|
A Boolean parameter specifying whether to use the client credentials flow. Use it for authentication flows with continuous integration and automation tools. |
|
Specifies the XM Cloud hosting URL. |
|
Path to the |
|
Write additional information about the command. |
|
Write diagnostics and detailed information about the command. |
|
Display developer help and usage information about the command. |