Passwordless Login with SMS
Learn how to use Marketing Cloud’s SMS capabilities to send verification codes for authenticating shoppers with the passwordless login feature of the Shopper Login and API Access Service (SLAS).
To complete the instructions in this guide, you must have:
- An active Commerce Cloud license.
- An active Marketing Cloud license with an SMS subscription.
- Admin access for your Marketing Cloud instance with permission to install apps.
- An SMS country code and short code for your Marketing Cloud instance.
- An installation link for the B2C Commerce-Marketing Cloud SMS Integration package.
👉 To provision an SMS short code, contact your Marketing Cloud account representative.
👉 To get the installation link for the integration package, reach out to your Salesforce contact.
- A shopper must log in via SLAS at least once before requesting a passwordless login.
- The shopper’s phone number must be registered with B2C Commerce.
- Sending SMS message for passwordless login counts towards your overall volume.
The B2C Commerce-Marketing Cloud SMS Integration package enables SLAS to integrate with Marketing Cloud’s SMS messaging functionality.
To install the package:
- Log in to your Marketing Cloud instance with your admin credentials.
- Click the installation link provided by your Salesforce contact.
- Click Install and agree to the terms and conditions.
Upon successful installation, you are taken to the package details page and a confirmation message is displayed.
To return to the package details page at any time:
- From Setup, in the Quick Find box, enter Installed Packages, and then select Installed Packages.
- Click B2C Commerce-Marketing Cloud SMS Integration.
After installing the package in your Marketing Cloud instance, you can use SLAS Admin UI to link a SLAS tenant with your Marketing Cloud account.
If you’re not already familiar with how to access SLAS Admin UI and create tenants, see Authorization for Shopper APIs.
To link a SLAS tenant with Marketing Cloud:
- Log in to SLAS Admin UI.
- Go to Integrations > Marketing Cloud Integrations.
- Click Add MC Integration.
- Choose a SLAS tenant that is set up for passwordless login.
- Click Link to MC.
- Enter your Marketing Cloud credentials.
Your SLAS tenant is now linked to your Marketing Cloud account!
In SLAS Admin UI, you can add an SMS definition from Integrations > Marketing Cloud Integrations. (You are already there if you’re continuing the instructions from the previous section.)
To add an SMS definition to your integration:
Click Add SMS Definition.
Enter the short code and country code provisioned in your Marketing Cloud instance.
- Short code example:
- Country code example:
- Short code example:
Now you’re ready to start sending some verification codes via SMS!
Don’t delete the SMS keyword that is used for passwordless SMS notification in your Marketing Cloud Instance. The SMS keyword uses the following format:
cc_<shortcode>_<countrycode>_<memberId>. Example SMS keyword:
To form requests to the SLAS Admin and SLAS APIs correctly, it helps to set some environment variables first:
|Short code for your B2C Commerce instance, not the short code that is provisioned for Marketing Cloud SMS|
|Tenant ID for your B2C Commerce instance|
|Organization ID for your B2C Commerce instance|
|Site name (also known as channel name) in Business Manager|
|URI for redirection after authorization|
|The SLAS client ID|
|The user ID for logging in the shopper|
|(not provided for security reasons)||Access token from SLAS Admin UI|
|(not provided for security reasons)||Access token from SLAS|
If you’re not using a Unix-based operating system, you can manually replace the variables later in the
curl command provided.
The following sample request uses the environment variables set earlier and the
passwordless-templates endpoint of the SLAS Admin API (not the same as the SLAS API) to create an SMS template for sending verification codes:
The following sample request uses the environment variables set earlier and the authorizePasswordlessCustomer endpoint of the SLAS API (not the same as the SLAS Admin API) to authorize a customer via SMS:
Here are some common issues with passwordless login via SMS and how to resolve them.
When installing the B2C Commerce-Marketing Cloud SMS Integration package, you get the following error message: “You do not have the required permissions to access Package Manager.”
Ensure that the account you are using has admin access for your Marketing Cloud instance with permission to install apps.
When you try to add the Marketing Cloud integration in SLAS Admin UI, you get the following error message: “Unauthorized - Unable to complete request because the app is not installed into this account or the user is not licensed for this package.”
An admin user must install the integration package in the Marketing Cloud instance before adding the integration in SLAS Admin UI.
When using the authorizePasswordlessCustomer endpoint, you get an error response like this:
Ensure that the SMS definition is set up in SLAS Admin UI for the right tenant with the correct short code and country code.
The SMS message isn’t delivered.
Delivery can fail for a number of reasons, including: invalid number, unreachable number, blocked number, incorrect short code, and incorrect country code.
If you can’t determine the reason, contact Salesforce Customer Support.