/b2c-cli:b2c-slasfrom b2c-cli
Manages SLAS shopper auth via the b2c CLI: clients, OAuth scopes, secrets, password templates, social login, and shopper sessions.
Ships in b2c-cli. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Use the b2c CLI plugin to manage SLAS (Shopper Login and API Access Service) tenants, API clients and credentials, password action templates, identity providers, and shopper sessions.
Important: SLAS is for shopper (customer) authentication used by storefronts and headless commerce. For admin tokens (OCAPI, Admin APIs), use
b2c auth token- see theb2c-configskill.
Tip: If
b2cis not installed globally, usenpx @salesforce/b2c-cliinstead (e.g.,npx @salesforce/b2c-cli slas client list).
Values like tenantId, shortCode, slasClientId, and slasClientSecret resolve from dw.json / SFCC_* env vars / the active instance / configuration plugins. Examples below show minimal usage; add flags only to override configured values — passing these as flags is usually unnecessary. If a required value is missing, the CLI emits an actionable error pointing at the flag, env var, and config key.
Run b2c setup inspect to see the resolved configuration and which source provided each value (--json for scripting; secrets stay masked by default). For precedence rules and troubleshooting, see the b2c-cli:b2c-config skill.
Relevant overrides:
--tenant-id / SFCC_TENANT_ID / tenantId--short-code / SFCC_SHORTCODE / shortCode--slas-client-id / SFCC_SLAS_CLIENT_ID / slasClientId--slas-client-secret / SFCC_SLAS_CLIENT_SECRET / slasClientSecret--site-id (alias --channel-id) / SFCC_SITE_ID / siteId — for client template and shopper logoutCommands that target an existing client (get, update, delete, open, and client template) use the configured slasClientId when their positional client ID is omitted. A positional client ID takes precedence over configuration.
Common scenarios requiring SLAS client management:
c_loyalty) to test your Custom API endpointsslas client template)slas idp)slas shopper logout)slas shopper delete)# list all SLAS clients for the configured tenant
b2c slas client list
# JSON output
b2c slas client list --json
# target a different tenant than the active config
b2c slas client list --tenant-id abcd_123
# get details for the configured SLAS client
b2c slas client get
# override the configured client ID
b2c slas client get my-client-id
# create a new SLAS client with default scopes (auto-generates UUID client ID)
b2c slas client create --channels RefArch --default-scopes --redirect-uri http://localhost:3000/callback
# create with a specific client ID and custom scopes
b2c slas client create my-client-id --channels RefArch --scopes sfcc.shopper-products,sfcc.shopper-search --redirect-uri http://localhost:3000/callback
# create a public client
b2c slas client create --channels RefArch --default-scopes --redirect-uri http://localhost:3000/callback --public
# create client without auto-creating tenant (if you manage tenants separately)
b2c slas client create --channels RefArch --default-scopes --redirect-uri http://localhost:3000/callback --no-create-tenant
# output as JSON (useful for capturing the generated secret)
b2c slas client create --channels RefArch --default-scopes --redirect-uri http://localhost:3000/callback --json
Note: By default, the tenant is automatically created if it doesn't exist.
Warning: Use --scopes (plural) for client scopes, NOT --auth-scope (singular). The --auth-scope flag is a global authentication option for OAuth scopes.
When testing a Custom API that requires custom scopes:
# Create a private client with custom scope for testing
# Replace c_my_scope with your API's custom scope from schema.yaml
b2c slas client create \
--channels RefArch \
--default-scopes \
--scopes "c_my_scope" \
--redirect-uri http://localhost:3000/callback \
--json
# Output includes client_id and client_secret - save these for token requests
Important: The custom scope in your SLAS client must match the scope defined in your Custom API's schema.yaml security section.
Use b2c slas token to obtain a shopper access token for API testing. The --site-id is specific to the request and must be provided per call.
The command applies shared HTTP middleware, including headers from SFCC_EXTRA_HEADERS
(a JSON object) or --extra-headers, to authorization, login, and token requests.
JSON output nests token fields under response (for example, .response.accessToken).
For authentication failures, use --log-level debug to capture HTTP status and the SLAS response correlation ID.
# Guest token with auto-discovery (finds first public SLAS client)
b2c slas token --site-id RefArch
# Registered customer token
b2c slas token --site-id RefArch --shopper-login [email protected] --shopper-password secret
# JSON output (includes refresh token, expiry, usid, etc.)
b2c slas token --site-id RefArch --json
# Use token in a subsequent API call
TOKEN=$(b2c slas token --site-id RefArch)
curl -H "Authorization: Bearer $TOKEN" "https://$SHORTCODE.api.commercecloud.salesforce.com/..."
# Override the SLAS client explicitly (e.g., targeting a private client for client_credentials flow)
b2c slas token --site-id RefArch --slas-client-id my-client --slas-client-secret sk_xxx
# Registered customer token against a private client (registered login is always PKCE-protected;
# the client secret is sent as Basic auth in addition to the PKCE code_verifier)
b2c slas token --site-id RefArch --slas-client-id my-client --slas-client-secret sk_xxx \
--shopper-login [email protected] --shopper-password secret
# update the configured client's display name
b2c slas client update --name "New Name"
# override the configured client ID and rotate its secret
b2c slas client update my-client-id --secret new-secret-value
# add scopes (appends to existing by default)
b2c slas client update my-client-id --scopes sfcc.shopper-baskets
# replace scopes instead of appending
b2c slas client update my-client-id --scopes sfcc.shopper-baskets --replace
# replace channels
b2c slas client update my-client-id --channels RefArch,SiteGenesis --replace
# delete the configured SLAS client
b2c slas client delete
# override the configured client ID
b2c slas client delete my-client-id
# open the configured SLAS client in the Admin UI
b2c slas client open
# override the configured client ID
b2c slas client open my-client-id
# restrict login endpoints to this client and use 6-digit passwordless codes
b2c slas client update my-client-id --login-restricted --six-digit-otp
# require client authentication on token requests (private clients only)
b2c slas client update my-client-id --strict-client-auth
# convert a public client to private (prints the generated secret once)
b2c slas client update my-client-id --private
Settings you don't pass keep their current values.
Templates are keyed by site, action type (PWDLESS_LOGIN, PWD_RESET_ACTION, PWD_RESET_CROSS_DEVICE_ACTION, WEBAUTHN_AUTHORIZE_USER), template type (EMAIL, SMS), and locale.
# list templates of a client for a site
b2c slas client template list my-client-id --site-id RefArch
# create an email template for passwordless login
b2c slas client template set my-client-id --site-id RefArch \
--action-type PWDLESS_LOGIN --template-type EMAIL --locale en-us \
--name "Login code" --subject "Your login code" \
--link 'https://example.com/login?token=${token}' --template-file login-email.html
# change one field of an existing template
b2c slas client template set my-client-id --site-id RefArch \
--action-type PWDLESS_LOGIN --template-type EMAIL --locale en-us --subject "Sign in"
# delete a template
b2c slas client template delete my-client-id --site-id RefArch \
--action-type PWDLESS_LOGIN --template-type EMAIL --locale en-us --force
Names are a provider (google, apple, okta, azure, auth0, facebook, ...) optionally followed by -<suffix>. For any other OpenID Connect provider use default and pass --claim-mapper (for example subject=sub,userId=sub,email=email,...). Use --idp-client-id/--idp-client-secret for the provider's credentials; --client-id/--client-secret are the Account Manager credentials that call SLAS.
b2c slas idp list
b2c slas idp get google
# create; the SLAS callback URL is filled in for new providers
b2c slas idp set google --idp-client-id 1234.apps.googleusercontent.com --idp-client-secret xxx \
--well-known-url https://accounts.google.com/.well-known/openid-configuration \
--auth-url https://accounts.google.com/o/oauth2/v2/auth --token-url https://oauth2.googleapis.com/token \
--token-info-url https://oauth2.googleapis.com/tokeninfo --user-info-url https://www.googleapis.com/oauth2/v3/userinfo \
--scopes openid,email,profile
# update a single field
b2c slas idp set google --preferred
b2c slas idp delete google --force
Secrets are masked in output unless you pass --show-secret.
b2c slas tenant get
b2c slas tenant set --merchant-name "Example Store" --contact "Ops Team" --email [email protected]
SLAS has no API to delete or list tenants.
These commands are destructive: they prompt for confirmation (use --force in scripts) and are blocked by the NO_UPDATE safety level.
# log shoppers out of all sessions (batches of 50; exits 1 if any fail)
b2c slas shopper logout --site-id RefArch --login-id [email protected],[email protected] --force
b2c slas shopper logout --site-id RefArch --file login-ids.txt --force --json
# delete a shopper's SLAS records (GDPR); the B2C Commerce customer profile is separate
b2c slas shopper delete abcdKZmKZm1234567890abcd --email [email protected] --force
See b2c slas --help for a full list of available commands and options in the slas topic.
b2c:b2c-custom-api-development - Creating Custom APIs that require SLAS authenticationb2c-cli:b2c-scapi-custom - Checking Custom API registration statusWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
slas, shopper-auth, oauth, salesforce-commerce, identity-providers
npx claudepluginhub salesforcecommercecloud/b2c-developer-tooling --plugin b2c-cli28 skills in this plugin
/b2c-amManage Account Manager resources including API clients, users, roles, and organizations. Use this skill whenever the user needs to create or update API clients, onboard or offboard developers, assign Account Manager roles scoped to tenants, audit user permissions, look up organizations, or provision API clients for CI/CD pipelines. Also use when managing AM role assignments or querying Account Manager data — even if they just say "add a new developer" or "set up an API client". For instance-level Business Manager administration (BM roles, BM users, BM access keys, BM whoami), defer to the `b2c-cli:b2c-bm-users-roles` skill./b2c-bm-users-rolesManage Business Manager users, access roles, role permissions, and per-user access keys on a B2C Commerce instance using the b2c CLI. Use this skill whenever the user needs to list or search BM users on a sandbox or production instance, identify which BM user an OAuth token resolves to ("whoami"), assign or revoke instance-level access roles, edit role permissions, look up a user's WebDAV / OCAPI / Storefront access key, or rotate access keys for SSO-managed users. Also use when the user asks "what's my BM login on sandbox X", "rotate my WebDAV password", "how do I make a custom BM role", "audit BM users on this instance", or "delete a stale BM user from a sandbox".Other plugins' skills for the same job