Skip to content

Commit 03b2b84

Browse files
committed
api client docs
1 parent d773046 commit 03b2b84

File tree

2 files changed

+17
-20
lines changed

2 files changed

+17
-20
lines changed

docs/guide/authentication.md

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,11 @@ For Account Manager operations that require user-level roles (organization and A
6060
- **Display Name**: A descriptive name (e.g., "B2C CLI")
6161
- **Password**: A strong client secret (save this securely for Client Credentials auth)
6262
5. Configure the **Token Endpoint Auth Method**:
63-
- `client_secret_post` for client credentials flow
63+
- `client_secret_basic` for client credentials flow
64+
65+
::: warning
66+
The B2C CLI only supports `client_secret_basic` for the Token Endpoint Auth Method. `client_secret_post` and `private_key_jwt` are not currently supported.
67+
:::
6468

6569
### Assigning Roles
6670

@@ -91,7 +95,7 @@ In Account Manager, navigate to your user account and add roles. Note that some
9195

9296
### Configuring Scopes
9397

94-
Under **Allowed Scopes**, add the following scopes based on your needs:
98+
Under **Default Scopes**, add the following scopes based on your needs:
9599

96100
| Scope | Purpose |
97101
| -------------- | --------------------------------------------------------- |
@@ -123,16 +127,6 @@ For ODS, SLAS, and SCAPI operations, your API client's roles must have a tenant
123127

124128
The tenant filter restricts which tenants/realms the role applies to.
125129

126-
### Default Scopes
127-
128-
Under **Default Scopes**, set scopes that are automatically requested. Recommended configuration:
129-
130-
```
131-
mail roles tenantFilter openid
132-
```
133-
134-
These scopes ensure proper authentication and authorization for CLI operations.
135-
136130
### Redirect URLs
137131

138132
For **User Authentication** (implicit flow), configure redirect URLs in your API client:
@@ -264,7 +258,7 @@ SCAPI commands (eCDN, SCAPI schemas, custom APIs) require OAuth authentication w
264258
### Required Setup
265259

266260
1. **Role:** Assign the `Salesforce Commerce API` role to your API client with appropriate tenant filter
267-
2. **Scopes:** Add required SCAPI scopes to your API client's Allowed Scopes
261+
2. **Scopes:** Add required SCAPI scopes to your API client's Default Scopes
268262

269263
### Scopes by Command
270264

@@ -275,7 +269,7 @@ SCAPI commands (eCDN, SCAPI schemas, custom APIs) require OAuth authentication w
275269
| `b2c ecdn` (read operations) | `sfcc.cdn-zones` | [eCDN](/cli/ecdn) |
276270
| `b2c ecdn` (write operations) | `sfcc.cdn-zones.rw` | [eCDN](/cli/ecdn) |
277271

278-
The CLI automatically requests these scopes. Your API client must have them in the Allowed Scopes list.
272+
The CLI automatically requests these scopes. Your API client must have them in the Default Scopes list.
279273

280274
::: tip
281275
For detailed authentication requirements including specific scopes for each command, see the individual [CLI command reference pages](/cli/).
@@ -383,8 +377,7 @@ Here's a complete example for setting up CLI access:
383377
- **Roles**:
384378
- `Salesforce Commerce API` - add tenant filter with your tenant IDs
385379
- `Sandbox API User` - if using ODS (add tenant filter)
386-
- **Allowed Scopes**: `mail roles tenantFilter openid sfcc.cdn-zones`
387-
- **Default Scopes**: `mail roles tenantFilter openid`
380+
- **Default Scopes**: `mail roles tenantFilter openid sfcc.cdn-zones`
388381
- **Redirect URLs**: `http://localhost:8080` (for user authentication)
389382

390383
### 2. Configure OCAPI (for code list/activate/delete, jobs, sites)
@@ -446,8 +439,8 @@ b2c scapi schemas list
446439

447440
### "Invalid scope" errors
448441

449-
- Add the required scopes to your API client's Allowed Scopes
450-
- For SCAPI commands, ensure the relevant `sfcc.*` scopes are in Allowed Scopes
442+
- Add the required scopes to your API client's Default Scopes
443+
- For SCAPI commands, ensure the relevant `sfcc.*` scopes are in Default Scopes
451444
- Verify Default Scopes includes `mail roles tenantFilter openid`
452445

453446
## Next Steps

packages/b2c-cli/src/utils/cip/report-command.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ import {
1515
import {CipCommand} from './command.js';
1616
import {renderTable, toCsv, type CipOutputFormat} from './format.js';
1717

18+
function camelToKebab(str: string): string {
19+
return str.replaceAll(/[A-Z]/gu, (match) => `-${match.toLowerCase()}`);
20+
}
21+
1822
interface CipReportDescribeOutput {
1923
description: string;
2024
name: string;
@@ -147,10 +151,10 @@ export abstract class CipReportCommand<T extends typeof Command> extends CipComm
147151
}
148152

149153
this.renderRows(
150-
['name', 'type', 'required', 'description'],
154+
['flag', 'type', 'required', 'description'],
151155
report.parameters.map((parameter) => ({
152156
description: parameter.description,
153-
name: parameter.name,
157+
flag: `--${camelToKebab(parameter.name)}`,
154158
required: parameter.required ? 'yes' : 'no',
155159
type: parameter.type,
156160
})),

0 commit comments

Comments
 (0)