You are here:
Create a SLAS Secret Key for SFRA Storefronts
SLAS is Salesforce B2C Commerce’s identity and token service for access to headless B2C Commerce APIs. For SFRA stores, create an external credential to store the shared secret key that SLAS uses to decrypt tokens sent from B2C Commerce.
We recommend that you create and save a new secret key every 90 days.
-
In your Salesforce org, at the top of the page, click
and select Setup.
- In the Quick Find box, enter and select Named Credentials.
-
On the External Credentials tab, click
New.
-
For the Label and Name,
enter
SFRA Shopper Agent Secret Keyas the label andsfra_shopper_agent_secret_keyas the name. - Under Authentication Protocol, select Custom.
-
Click Save.
The page for the new named credential opens with more sections.
-
For the Label and Name,
enter
-
Generate a secret key.
-
Open a terminal window, and generate a shared secret key by entering
the command run command
openssl rand -base64 32. -
Copy the output.You specify this key when you add a principal tied to your named credential.
-
Open a terminal window, and generate a shared secret key by entering
the command run command
-
Return to the named credential page, and under Principals, click
New.
-
In Parameter Name, enter
SharedSecretKeys. Accept the default values for the other fields. - Add an authentication parameter.
-
Enter
SharedKeyas the name. - In Value, paste the secret key.
-
Save your changes.
-
In Parameter Name, enter
-
For SFRA stores, add the secret key to your Service Credentials in B2C
Commerce.
-
In Business Manager, click App Launcher
, and then select .
- Click New.
-
Enter
sfra_agent_secret_keyas the name. - In the password field, paste the secret key.
-
Click Apply.
- In the Profiles tab, click New.
-
Add a profile with the name
sfra_agent_secret_key. -
Click Apply.
- In the Services tab, click New.
-
Add a service with the name
sfra_agent_secret_key. - In the Type dropdown, select Generic.
-
In the Profile and Credentials dropdown, select
sfra_agent_secret_key. -
Click Apply.
-
In Business Manager, click App Launcher
-
Update the Agent script in Agentforce Builder. Find the SFRA storefront
settings, and set
useSfraApito true, and setsfraNamedCredentialto the name of the agent.- Select the agent, then select Agent Settings.
- Select Agent Script mode, and find the SFRA storefront (optional) code block.
-
Set
useSfraApito true, andsfraNamedCredentialto the name of the agent. Example:
# SFRA storefront (optional). When useSfraApi is truthy, cart and # product actions call SFRA; otherwise they call SCAPI directly. useSfraApi: string = "true" label: "Use SFRA API" sfraNamedCredential: string = "sframystorefront_NC" label: "sfraNamedCredential" description: "SFRA named credential."
