When standing up Sitecore Commerce 10.1.0, you may run across the following two errors while attempting to register as a user:
“Invalid or missing value for property Domain”.
”User created but external Id was not provided”
The reason this is occurring is that you need to ensure your storefront domain is properly entered in two distinct places across your Commerce Engine roles before performing a bootstrap
- Within the domains.config file (Ex: wwwroot\XP0.sc\App_Config\Security\Domains.config) of the CM and CD roles, it needs to reflect your storefront domain:
Ex: <domain name=”Storefront” locallyManaged=”true” />
- Within the domain section of the PlugIn.Habitat.CommerceShops-1.0.0.json file of a Commerce Engine role (Ex wwwroot\CommerceAuthoring_Sc9\wwwroot\data\Environments\PlugIn.Habitat.CommerceShops-1.0.0.json), you need to have the exact match of what you placed in your domains.config
Ex: “Domains”: [“Storefront“,”extranet”,”CommerceUsers”]
- Make sure to do this for all relevant Commerce Engine roles in your environment (ex. authoring, shops, minions, ops)
- Post ensuring these values are in place across the Engine roles, make sure to conduct a bootstrap
Full details of these steps can also be found here: Security domains in SXA Storefront (sitecore.com)
What If You Are Running Commerce in Containers?
Sitecore Commerce 10.1 runs in AKS (Azure Kubernetes Service). Within an Azure Kubernetes Cluster, you would need to access the persistent storage to find the domains.config file. Typically, this is shared between the CM and CD nodes. As images are immutable (you can’t change the config in the node), you would need to change this value in your source control and create new Commerce Engine role images that are then deployed to AKS that includes this value.