Skip to content

Commit c9a2815

Browse files
committed
doc updates
1 parent ca3f4fd commit c9a2815

9 files changed

Lines changed: 465 additions & 86 deletions

File tree

docs/.vitepress/config.mts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ const guideSidebar = [
77
items: [
88
{ text: 'Introduction', link: '/guide/' },
99
{ text: 'Installation', link: '/guide/installation' },
10+
{ text: 'Authentication Setup', link: '/guide/authentication' },
1011
{ text: 'Configuration', link: '/guide/configuration' },
1112
],
1213
},

docs/cli/auth.md

Lines changed: 30 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -84,42 +84,57 @@ b2c auth token | pbcopy # macOS: copy to clipboard
8484

8585
## Authentication Overview
8686

87-
The CLI supports multiple authentication methods depending on the operation:
87+
The CLI supports multiple authentication methods depending on the operation.
8888

89-
### OAuth Client Credentials
89+
### Account Manager API Client (OAuth)
9090

91-
Most commands use OAuth client credentials authentication:
91+
Most instance operations require an Account Manager API Client. The CLI supports two OAuth flows:
92+
93+
| Auth Method | Description | Use Case |
94+
|-------------|-------------|----------|
95+
| User Authentication | Interactive browser-based login | Development, manual operations |
96+
| Client Credentials | Non-interactive with client ID/secret | CI/CD, automation, scripts |
9297

9398
```bash
99+
# Client Credentials
94100
export SFCC_CLIENT_ID=my-client
95101
export SFCC_CLIENT_SECRET=my-secret
96102
```
97103

98-
Required for:
104+
Used by:
99105
- Code management (`code list`, `code activate`, `code delete`)
100106
- Job operations (`job run`, `job search`, `job import`, `job export`)
101107
- Site operations (`sites list`)
102-
- ODS operations
103-
- SLAS operations
104-
- MRT operations
108+
- ODS operations (requires `Sandbox API User` role)
109+
- SLAS operations (requires `SLAS Organization Administrator` or `Sandbox API User` role)
105110

106111
### Basic Auth (WebDAV)
107112

108-
WebDAV operations support Basic Auth for better performance:
113+
WebDAV operations support Basic Auth using your Business Manager username and WebDAV access key:
109114

110115
```bash
111116
export SFCC_USERNAME=my-user
112-
export SFCC_PASSWORD=my-access-key
117+
export SFCC_PASSWORD=my-webdav-access-key
113118
```
114119

115120
Used by:
116121
- `code deploy` (file upload)
117122
- `code watch` (file upload)
118123
- `webdav` commands
119124

125+
### MRT API Key
126+
127+
Managed Runtime commands use a separate API key obtained from the MRT dashboard:
128+
129+
```bash
130+
export SFCC_MRT_API_KEY=your-mrt-api-key
131+
```
132+
133+
See [MRT Commands](./mrt#authentication) for details.
134+
120135
### Mixed Authentication
121136

122-
Some commands (like `code deploy`) require both OAuth and WebDAV access. You can provide both:
137+
Some commands (like `code deploy` with `--reload`) require both OAuth and WebDAV access:
123138

124139
```bash
125140
export SFCC_CLIENT_ID=my-client
@@ -131,7 +146,7 @@ b2c code deploy --reload
131146

132147
### Configuration File
133148

134-
Credentials can also be stored in a `dw.json` file:
149+
Credentials can be stored in a `dw.json` file:
135150

136151
```json
137152
{
@@ -143,3 +158,7 @@ Credentials can also be stored in a `dw.json` file:
143158
```
144159

145160
Use `--config` to specify a custom config file path, or `--instance` to select a named instance configuration.
161+
162+
### Tenant Scope
163+
164+
For ODS and SLAS operations, your API client must have tenant scope configured for the realm/organization you wish to manage. This is set up in Account Manager when creating or editing the API client.

docs/cli/mrt.md

Lines changed: 34 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,40 @@ MRT commands resolve configuration in the following order of precedence:
2121
3. `dw.json` file (`mrtProject`, `mrtEnvironment` fields)
2222
4. `~/.mobify` config file (for `api_key`)
2323

24+
## Authentication
25+
26+
MRT commands use API key authentication. The API key is configured in the Managed Runtime dashboard and grants access to specific projects.
27+
28+
### Getting an API Key
29+
30+
1. Log in to the [Managed Runtime dashboard](https://runtime.commercecloud.com/)
31+
2. Navigate to **Account Settings** > **API Keys**
32+
3. Create a new API key or use an existing one
33+
4. The API key grants access to all projects in your organization
34+
35+
### Configuration
36+
37+
Provide the API key via one of these methods (in order of precedence):
38+
39+
1. **Command-line flag**: `--api-key your-api-key`
40+
2. **Environment variable**: `export SFCC_MRT_API_KEY=your-api-key`
41+
3. **Mobify config file**: `~/.mobify` with `api_key` field
42+
43+
### Example ~/.mobify File
44+
45+
```json
46+
{
47+
"api_key": "your-mrt-api-key"
48+
}
49+
```
50+
51+
### Project Access
52+
53+
Your API key provides access to all projects in your MRT organization. Specify the project using:
54+
55+
- `--project` flag or `SFCC_MRT_PROJECT` environment variable
56+
- `mrtProject` field in `dw.json`
57+
2458
---
2559

2660
## b2c mrt push
@@ -339,25 +373,3 @@ b2c mrt env var delete MY_VAR --project acme-storefront --environment production
339373
# Short form
340374
b2c mrt env var delete OLD_API_KEY -p my-project -e staging
341375
```
342-
343-
---
344-
345-
## Authentication
346-
347-
All MRT commands use API key authentication. You can provide credentials in several ways:
348-
349-
1. **Command-line flag**: `--api-key your-api-key`
350-
2. **Environment variable**: `export SFCC_MRT_API_KEY=your-api-key`
351-
3. **Mobify config file**: `~/.mobify` with `api_key` field
352-
353-
### Getting an API Key
354-
355-
Obtain your MRT API key from the Managed Runtime dashboard in your Salesforce Commerce Cloud account.
356-
357-
### Example ~/.mobify File
358-
359-
```json
360-
{
361-
"api_key": "your-mrt-api-key"
362-
}
363-
```

docs/cli/ods.md

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,34 @@ These flags are available on all ODS commands:
1010
|------|---------------------|-------------|
1111
| `--sandbox-api-host` | `SFCC_SANDBOX_API_HOST` | ODS API hostname (default: admin.dx.commercecloud.salesforce.com) |
1212

13-
### Authentication
13+
## Authentication
1414

15-
ODS commands require OAuth authentication. Provide `--client-id` and `--client-secret` or set the corresponding environment variables.
15+
ODS commands require an Account Manager API Client with appropriate roles.
16+
17+
### Required Roles
18+
19+
| Auth Method | Role | Description |
20+
|-------------|------|-------------|
21+
| User Authentication | `Sandbox API User` | For interactive/browser-based authentication |
22+
| Client Credentials | `Sandbox API User` | For automated/service authentication |
23+
24+
### Tenant Scope
25+
26+
The API client must have tenant scope configured for the realm(s) you wish to manage. This is configured in Account Manager when setting up the API client.
27+
28+
### Configuration
29+
30+
Provide credentials via flags or environment variables:
31+
32+
```bash
33+
# Client Credentials
34+
export SFCC_CLIENT_ID=my-client
35+
export SFCC_CLIENT_SECRET=my-secret
36+
b2c ods list
37+
38+
# Or via flags
39+
b2c ods list --client-id xxx --client-secret yyy
40+
```
1641

1742
---
1843

docs/cli/slas.md

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,34 @@ These flags are available on all SLAS commands:
1010
|------|---------------------|-------------|
1111
| `--tenant-id` | `SFCC_TENANT_ID` | (Required) SLAS tenant ID (organization ID) |
1212

13-
### Authentication
13+
## Authentication
1414

15-
SLAS commands require OAuth authentication. Provide `--client-id` and `--client-secret` or set the corresponding environment variables.
15+
SLAS commands require an Account Manager API Client with appropriate roles.
16+
17+
### Required Roles
18+
19+
| Auth Method | Role | Description |
20+
|-------------|------|-------------|
21+
| User Authentication | `SLAS Organization Administrator` | For interactive/browser-based authentication |
22+
| Client Credentials | `Sandbox API User` | For automated/service authentication |
23+
24+
### Tenant Scope
25+
26+
The API client must have tenant scope configured for the realm/organization you wish to manage. This is configured in Account Manager when setting up the API client.
27+
28+
### Configuration
29+
30+
Provide credentials via flags or environment variables:
31+
32+
```bash
33+
# Client Credentials
34+
export SFCC_CLIENT_ID=my-client
35+
export SFCC_CLIENT_SECRET=my-secret
36+
b2c slas client list --tenant-id abcd_123
37+
38+
# Or via flags
39+
b2c slas client list --tenant-id abcd_123 --client-id xxx --client-secret yyy
40+
```
1641

1742
---
1843

docs/cli/webdav.md

Lines changed: 39 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,47 @@ Available roots:
2424
- `logs` - Log files
2525
- `securitylogs` - Security log files
2626

27-
### Authentication
27+
## Authentication
28+
29+
WebDAV commands require authentication to access instance files.
30+
31+
### Basic Auth (Recommended)
32+
33+
Basic Auth provides better performance for WebDAV operations using your Business Manager username and WebDAV access key:
34+
35+
```bash
36+
export SFCC_USERNAME=my-user
37+
export SFCC_PASSWORD=my-webdav-access-key
38+
b2c webdav ls
39+
```
40+
41+
Or via flags:
42+
43+
```bash
44+
b2c webdav ls -u my-user -p my-access-key
45+
```
2846

29-
WebDAV commands support both Basic Auth and OAuth authentication:
47+
### OAuth
3048

31-
- **Basic Auth** (recommended for performance): `--username` and `--password`
32-
- **OAuth**: `--client-id` and `--client-secret`
49+
OAuth can also be used with an Account Manager API Client:
50+
51+
```bash
52+
export SFCC_CLIENT_ID=my-client
53+
export SFCC_CLIENT_SECRET=my-secret
54+
b2c webdav ls
55+
```
56+
57+
### Mixed Authentication
58+
59+
For operations that require both WebDAV and OCAPI (like `code deploy`), you can provide both:
60+
61+
```bash
62+
export SFCC_USERNAME=my-user
63+
export SFCC_PASSWORD=my-access-key
64+
export SFCC_CLIENT_ID=my-client
65+
export SFCC_CLIENT_SECRET=my-secret
66+
b2c code deploy
67+
```
3368

3469
---
3570

@@ -291,47 +326,3 @@ b2c webdav unzip --root=cartridges my-cartridge.zip
291326

292327
- Contents are extracted to the same directory as the zip file
293328
- This operation is performed server-side
294-
295-
---
296-
297-
## Authentication
298-
299-
WebDAV commands require authentication to access instance files.
300-
301-
### Basic Auth (Recommended)
302-
303-
Basic Auth provides better performance for WebDAV operations:
304-
305-
```bash
306-
export SFCC_USERNAME=my-user
307-
export SFCC_PASSWORD=my-access-key
308-
b2c webdav ls
309-
```
310-
311-
Or via flags:
312-
313-
```bash
314-
b2c webdav ls -u my-user -p my-access-key
315-
```
316-
317-
### OAuth
318-
319-
OAuth can also be used:
320-
321-
```bash
322-
export SFCC_CLIENT_ID=my-client
323-
export SFCC_CLIENT_SECRET=my-secret
324-
b2c webdav ls
325-
```
326-
327-
### Mixed Authentication
328-
329-
For operations that require both WebDAV and OCAPI (like `code deploy`), you can provide both:
330-
331-
```bash
332-
export SFCC_USERNAME=my-user
333-
export SFCC_PASSWORD=my-access-key
334-
export SFCC_CLIENT_ID=my-client
335-
export SFCC_CLIENT_SECRET=my-secret
336-
b2c code deploy
337-
```

0 commit comments

Comments
 (0)