Skip to content

Add slas token command for SLAS shopper access tokens#232

Open
clavery wants to merge 2 commits intomainfrom
feature/slas-token
Open

Add slas token command for SLAS shopper access tokens#232
clavery wants to merge 2 commits intomainfrom
feature/slas-token

Conversation

@clavery
Copy link
Collaborator

@clavery clavery commented Mar 4, 2026

Summary

  • Adds b2c slas token command to retrieve SLAS shopper access tokens for API testing
  • Supports public client (PKCE), private client (client_credentials), guest and registered customer flows
  • Auto-discovers the first public SLAS client when --slas-client-id is omitted
  • Adds slasClientId, slasClientSecret, and siteId to the config system (dw.json, env vars, flags)
  • New SDK module (@salesforce/b2c-tooling-sdk/slas) with typed token retrieval functions and PKCE helpers
  • JSON output separates response (raw SLAS fields) from decodedJWT (decoded token payload)
  • Fixes test isolation: stubParse now defaults config: '/dev/null' to prevent dw.json leakage
  • Adds parseRedirectUris() helper to handle pipe-delimited redirect URIs from the SLAS API

Test plan

  • SDK PKCE tests (verifier length, base64url encoding, challenge correctness)
  • SDK token flow tests (public guest PKCE, private guest client_credentials, registered public, registered private, error handling) via MSW
  • CLI command tests (JSON output structure, client_credentials, auto-discovery error, missing flags, registered flow, decodedJWT presence/absence)
  • All 972 CLI tests pass
  • All SDK tests pass
  • Lint clean (pnpm run lint:agent)

Supports public (PKCE) and private (client_credentials) client flows,
guest and registered customer authentication, and auto-discovery of
public SLAS clients via the admin API.
@clavery clavery force-pushed the feature/slas-token branch from 610ffb3 to 1485c7a Compare March 4, 2026 02:24
@clavery
Copy link
Collaborator Author

clavery commented Mar 5, 2026

@amit-kumar8-sf any reason why you merged main into my PR?

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.

2 participants