Skip to content

Add --default-client to sign in with the built-in client - #838

Merged
clavery merged 1 commit into
mainfrom
feature/default-client
Oct 31, 2026
Merged

clavery merged 1 commit into
mainfrom
feature/default-client

Conversation

@clavery

@clavery clavery commented Oct 30, 2026

Copy link
Copy Markdown
Collaborator

Summary

When a project configures an OAuth client or a WebDAV access key, there was no simple way to sign in with the CLI's built-in public client instead. You had to pass the built-in client's ID by hand, and that ID differs per Account Manager host. This matters when the configured client isn't set up for browser sign-in, or when you want to act with your own Business Manager permissions on an instance your project already configures.

--default-client (or SFCC_DEFAULT_CLIENT=true) makes a command behave as if no client were configured:

  • It ignores any configured client ID, secret, client auth method, and JWT, from any source (dw.json, env vars, keychain), and forces browser sign-in (user). Other settings such as the server still apply.
  • --client-id, --client-secret, --jwt-cert, --jwt-key, --auth-methods, or the auth login client ID argument on the command line conflict with it and fail. The same values from env vars or config are overridden.
  • It never reuses a stored sign-in for another client.
  • It works for auth login, WebDAV, code upload, logs, sandbox, and Account Manager commands. OCAPI and SCAPI commands fail with a clear error, because the built-in client has no API access.

The flag is new and opt-in, so nothing changes without it.

Testing

Manual:

  1. With a dw.json that configures a client (and optionally a WebDAV username and access key), run b2c auth login --default-client. It should sign in with the built-in client.
  2. Run b2c webdav ls --root temp --default-client against that instance. It should use that sign-in, not the configured client or access key.
  3. Run an OCAPI command such as b2c sites list --default-client. It should fail with the "no OCAPI or SCAPI access" error.
  4. Run b2c webdav ls --root temp --default-client --client-id x. It should be rejected as a conflict.

When a client or access key is configured, there was no way to sign in
with the CLI's built-in public client short of passing its client ID by
hand. --default-client (SFCC_DEFAULT_CLIENT) ignores any configured OAuth
client, secret, or JWT, and forces browser sign-in, while keeping the rest
of the configuration such as the server. Client flags on the command line
conflict with it; values from env vars or config are overridden. OCAPI and
SCAPI commands reject it because the built-in client has no API access.
@clavery
clavery requested a review from a team October 30, 2026 21:34
@clavery
clavery deployed to b2c-docs-preview October 30, 2026 21:34 — with GitHub Actions Active
@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

📘 Docs preview

🧹 The preview for this PR has been removed (PR closed).

@clavery
clavery merged commit 779ae04 into main Oct 31, 2026
16 checks passed
@clavery
clavery deleted the feature/default-client branch October 31, 2026 00:24
@clavery
clavery deployed to b2c-docs-preview October 31, 2026 00:24 — with GitHub Actions Active

This branch was successfully deployed

1 active deployment
b2c-docs-preview — ee931a04 Deployed Oct 31, 2026 by clavery via Remove preview on close #1187
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant