Skip to content

Commit ee34526

Browse files
Merge branch 'main' into feature-W-20893800-add-stateful-auth-support
2 parents b6ec707 + 03b2b84 commit ee34526

2 files changed

Lines changed: 17 additions & 20 deletions

File tree

docs/guide/authentication.md

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,11 @@ For Account Manager operations that require user-level roles (organization and A
7474
- **Display Name**: A descriptive name (e.g., "B2C CLI")
7575
- **Password**: A strong client secret (save this securely for Client Credentials auth)
7676
5. Configure the **Token Endpoint Auth Method**:
77-
- `client_secret_post` for client credentials flow
77+
- `client_secret_basic` for client credentials flow
78+
79+
::: warning
80+
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.
81+
:::
7882

7983
### Assigning Roles
8084

@@ -105,7 +109,7 @@ In Account Manager, navigate to your user account and add roles. Note that some
105109

106110
### Configuring Scopes
107111

108-
Under **Allowed Scopes**, add the following scopes based on your needs:
112+
Under **Default Scopes**, add the following scopes based on your needs:
109113

110114
| Scope | Purpose |
111115
| -------------- | --------------------------------------------------------- |
@@ -137,16 +141,6 @@ For ODS, SLAS, and SCAPI operations, your API client's roles must have a tenant
137141

138142
The tenant filter restricts which tenants/realms the role applies to.
139143

140-
### Default Scopes
141-
142-
Under **Default Scopes**, set scopes that are automatically requested. Recommended configuration:
143-
144-
```
145-
mail roles tenantFilter openid
146-
```
147-
148-
These scopes ensure proper authentication and authorization for CLI operations.
149-
150144
### Redirect URLs
151145

152146
For **User Authentication** (implicit flow), configure redirect URLs in your API client:
@@ -278,7 +272,7 @@ SCAPI commands (eCDN, SCAPI schemas, custom APIs) require OAuth authentication w
278272
### Required Setup
279273

280274
1. **Role:** Assign the `Salesforce Commerce API` role to your API client with appropriate tenant filter
281-
2. **Scopes:** Add required SCAPI scopes to your API client's Allowed Scopes
275+
2. **Scopes:** Add required SCAPI scopes to your API client's Default Scopes
282276

283277
### Scopes by Command
284278

@@ -289,7 +283,7 @@ SCAPI commands (eCDN, SCAPI schemas, custom APIs) require OAuth authentication w
289283
| `b2c ecdn` (read operations) | `sfcc.cdn-zones` | [eCDN](/cli/ecdn) |
290284
| `b2c ecdn` (write operations) | `sfcc.cdn-zones.rw` | [eCDN](/cli/ecdn) |
291285

292-
The CLI automatically requests these scopes. Your API client must have them in the Allowed Scopes list.
286+
The CLI automatically requests these scopes. Your API client must have them in the Default Scopes list.
293287

294288
::: tip
295289
For detailed authentication requirements including specific scopes for each command, see the individual [CLI command reference pages](/cli/).
@@ -397,8 +391,7 @@ Here's a complete example for setting up CLI access:
397391
- **Roles**:
398392
- `Salesforce Commerce API` - add tenant filter with your tenant IDs
399393
- `Sandbox API User` - if using ODS (add tenant filter)
400-
- **Allowed Scopes**: `mail roles tenantFilter openid sfcc.cdn-zones`
401-
- **Default Scopes**: `mail roles tenantFilter openid`
394+
- **Default Scopes**: `mail roles tenantFilter openid sfcc.cdn-zones`
402395
- **Redirect URLs**: `http://localhost:8080` (for user authentication)
403396

404397
### 2. Configure OCAPI (for code list/activate/delete, jobs, sites)
@@ -460,8 +453,8 @@ b2c scapi schemas list
460453

461454
### "Invalid scope" errors
462455

463-
- Add the required scopes to your API client's Allowed Scopes
464-
- For SCAPI commands, ensure the relevant `sfcc.*` scopes are in Allowed Scopes
456+
- Add the required scopes to your API client's Default Scopes
457+
- For SCAPI commands, ensure the relevant `sfcc.*` scopes are in Default Scopes
465458
- Verify Default Scopes includes `mail roles tenantFilter openid`
466459

467460
## 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)