You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
bm.md:
- Lead the Authentication section with the two flows (client-credentials
vs user-auth) and explicit setup before the "defaults" table.
- Document --user-auth, --auth-methods, and SFCC_AUTH_METHODS overrides
with concrete examples.
- Annotate the OCAPI permissions table with which command uses each
resource so readers know what to grant.
- Add a dedicated subsection on the Manage_Users_Access_Keys BM
functional permission required for access-key writes.
- Add Configuration Examples block.
authentication.md:
- Add "BM administration" entry under "Minimal Configuration by Feature"
with the importable JSON snippet covering /roles, /users, /users/this,
/users/*/access_key/*, and /user_search.
- Add a tip box explaining the user-identity requirement on whoami /
access-key endpoints and cross-link back to /cli/bm#authentication.
Both pages now properly cross-link to each other.
Copy file name to clipboardExpand all lines: docs/cli/bm.md
+50-17Lines changed: 50 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,33 +8,66 @@ Commands for administering instance-level Business Manager resources via the OCA
8
8
9
9
## Authentication
10
10
11
-
Most BM commands accept either client credentials or browser-based user authentication. A handful require a *real BM user identity* — the CLI defaults those to user-auth automatically.
11
+
BM commands authenticate via OAuth against the configured Commerce Cloud instance. Two flows are supported:
12
+
13
+
-**Client credentials** — for automation and CI/CD. Configure an Account Manager API client and grant it the OCAPI permissions listed below. Pass credentials via `--client-id` / `--client-secret`, the `SFCC_CLIENT_ID` / `SFCC_CLIENT_SECRET` environment variables, or `dw.json`.
14
+
-**User auth (browser)** — for interactive use. Pass `--user-auth` (or run `b2c auth login` once and reuse the saved session). The CLI opens a browser and the resulting token carries your BM user identity.
15
+
16
+
A handful of endpoints require *a real BM user identity* and cannot use service-client tokens — the CLI defaults those to user-auth automatically:
|`b2c bm whoami`|**implicit (browser)**|OCAPI `/users/this` requires the token to resolve to a BM user |
18
-
|`b2c bm access-key ...`|**implicit (browser)**|OCAPI access-key endpoints require "a valid user" plus the `Manage_Users_Access_Keys` functional permission |
22
+
|`b2c bm whoami`|**implicit (browser)**|`/users/this` requires the token to resolve to a BM user |
23
+
|`b2c bm access-key ...`|**implicit (browser)**|Access-key endpoints require *a valid user* plus the `Manage_Users_Access_Keys` BM functional permission |
19
24
20
-
Override the default with `--auth-methods client-credentials` (or `--client-secret` flags) when your service-client setup is configured to issue user-bearing tokens.
25
+
Override the auto-defaulted user-auth with `--auth-methods client-credentials` (or `--client-secret`) when your service-client setup is configured to issue user-bearing tokens. The interactive defaults can also be skipped end-to-end by exporting `SFCC_AUTH_METHODS=client-credentials,jwt` in CI.
21
26
22
-
For complete setup instructions see the [Authentication Guide](/guide/authentication).
27
+
See the [Authentication Guide](/guide/authentication) for end-to-end setup, including the [BM administration OCAPI snippet](/guide/authentication#minimal-configuration-by-feature).
Access-key writes additionally require the `Manage_Users_Access_Keys` functional permission on the BM user account.
31
+
Add these resources to the Data API client configuration in Business Manager (**Administration** > **Site Development** > **Open Commerce API Settings** > **Data API**):
For an importable JSON snippet covering all BM administration endpoints, see [Minimal Configuration by Feature](/guide/authentication#minimal-configuration-by-feature) in the Authentication Guide.
47
+
48
+
### Required BM Functional Permission
49
+
50
+
Access-key writes (`bm access-key {create,set,delete}`) additionally require the **Manage_Users_Access_Keys** BM functional permission on the user account performing the request. Grant it via Business Manager: **Administration** > **Roles & Permissions**. This is why the CLI defaults `bm access-key` commands to user-auth — service clients cannot carry BM functional permissions.
51
+
52
+
### Configuration Examples
53
+
54
+
```bash
55
+
# Interactive (browser login on first command, session reused after):
56
+
b2c auth login --instance my-sandbox
57
+
b2c bm whoami
58
+
59
+
# Client credentials (where supported):
60
+
export SFCC_CLIENT_ID=your-client-id
61
+
export SFCC_CLIENT_SECRET=your-client-secret
62
+
export SFCC_SERVER=my-sandbox.demandware.net
63
+
b2c bm users list
64
+
65
+
# Force user-auth on a command that defaults to client-credentials:
66
+
b2c bm users list --user-auth
67
+
68
+
# Force client-credentials on a command that defaults to user-auth (advanced):
69
+
b2c bm access-key get --auth-methods client-credentials
`bm whoami` and the `bm access-key` family additionally require *a real BM user identity*. Service-client tokens cannot resolve to a BM user, so the CLI defaults these commands to browser-based user auth. Access-key writes also require the **Manage_Users_Access_Keys** BM functional permission on the user account performing the request — grant it via **Administration** > **Roles & Permissions** in Business Manager. See [BM Commands → Authentication](/cli/bm#authentication) for details.
473
+
:::
474
+
426
475
## SCAPI Authentication
427
476
428
477
SCAPI commands (eCDN, SCAPI schemas, custom APIs) require OAuth authentication with specific roles and scopes.
0 commit comments