This cartridge is maintained by the Salesforce Community. Salesforce Commerce Cloud and Salesforce Platform Technical Support do not support this project or its setup. Enhancements and defect resolution will be driven by the Salesforce Community. You are invited to log an issue or submit a pull-request to advance this project.
This cartridge is a proof of concept for integrating Microsoft Azure OAuth with Salesforce Commerce Cloud B2C.
Currently, dw.customer.oauth.OAuthLoginFlowMgr
does not support passing the access token in the header, which Azure's UserInfo endpoint requires.
Instead of calling OAuthLoginFlowMgr.finalizeOAuthLogin()
, we will call OAuthLoginFlowMgr.obtainAccessToken()
,
and then make a custom HTTP call to the UserInfo endpoint.
This cartridge also includes an optional feature to merge external profiles with existing customer accounts. This will ensure if you have existing SFCC shopper accounts, the external profile will be added to the existing account, rather than creating a new customer profile, allowing for order history and profile data to accessed from the same login.
Note: Requires minimum compatibility mode 21.2.
- Clone this repository. The name of the top-level directory is
sfcc-azure-oauth
. - From the
sfcc-azure-oauth
directory, runnpm install
. This command installs all the package dependencies. - Create a
dw.json
file in the root directory of the repository. Providing a WebDAV access key from BM in thepassword
field is optional, as you will be prompted if it is not provided.
{
"hostname": "your-sandbox-hostname.commercecloud.salesforce.com",
"username": "AM username like me.myself@company.com",
"password": "your_webdav_access_key",
"code-version": "version_to_upload_to"
}
- Enter the following command:
npm run uploadCartridge
.
For more information on uploading the cartridge, see the following topic on the B2C Commerce Infocenter: Upload Code for SFRA.
This plugin requires the app_storefront_base
cartridge.
- Log in to Business Manager.
- Go to Administration > Sites > Manage Sites.
- Select the site that you want to use Azure Login.
- Click the Settings tab.
- In the Cartridges field, add the new cartridge path:
int_azure
. It must be added before the path forapp_storefront_base
. Example path:int_azure:app_storefront_base
- Zip the data/site_template_azure folder:
npm run data:zip:main
- Go to Administration > Site Development > Site Import & Export.
- Click Browse
- Select the
site_template_azure.zip
file - Click Upload.
- Select
site_template_azure.zip
- Click Import.
For help setting up your Azure Client ID and Client Secret, please refer to the following documenation:
Once you have established your Client ID
and Client Secret Value
, update the values in Business Manager:
- Go to Administration > Global Preferences > OAuth2 Providers > Azure
- Update Client ID
- Update Client Secret
- Click Apply
If you wish to have external accounts merged with SFCC shopper accounts, enable the enableMergeExternalAccounts
site preference:
- Go to Merchant Tools > Site Preferences > Custom Site Preference Groups
- Click the ExternalAccounts Label
- Select Yes
- Click Save
Before committing code to this project, please run the following scripts and ensure they run without error.
npm run lint
Licensed under the current NDA and licensing agreement in place with your organization. (This is explicitly not open source licensing.)
This project should not be treated as Salesforce Product. It is a tool and strategy for B2C projects. Customers and partners implement this at-will with no expectation of roadmap, technical support, defect resolution, production-style SLAs.
This project is maintained by the Salesforce Community. Salesforce Commerce Cloud or Salesforce Platform Technical Support do not support this project or its setup.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED.
For feature requests or bugs, please open a GitHub issue.