@salesforce/b2c-tooling-sdk / auth / resolveSystemOAuthStrategy
Function: resolveSystemOAuthStrategy()
resolveSystemOAuthStrategy(
credentials,methods):AuthStrategy|undefined
Defined in: packages/b2c-tooling-sdk/src/auth/resolve.ts:277
Builds a stateless, scope-flexible system OAuth strategy — client-credentials or JWT Bearer — or undefined when neither is fully configured.
These are the only flows that can request arbitrary sfcc.* scopes from Account Manager per call (via the scope-cascade / additional-scopes hooks the SCAPI client factories rely on). Browser user-auth (PKCE/implicit) and fixed-token stored sessions are intentionally excluded, so this is the shared definition of "SCAPI-eligible auth" used by both B2CInstance.scapiClientConfig and MrtCommand.getScapiMrtConfig.
Unlike resolveAuthStrategy, this handles JWT (which needs cert/key paths not present on AuthCredentials) and never throws — callers treat undefined as "not SCAPI-eligible". The Account Manager host default is applied by the strategy constructors, so accountManagerHost may be passed through as-is.
Parameters
credentials
The available system OAuth credentials.
methods
AuthMethod[] = ...
Allowed methods in priority order. Defaults to client-credentials before JWT, matching the CLI's auth priority.
Returns
AuthStrategy | undefined
The first eligible strategy, or undefined if none is configured.