cli icon indicating copy to clipboard operation
cli copied to clipboard

Enable Enhanced Domains (and Edge Network) when creating a scratch org

Open daveespo opened this issue 3 years ago • 4 comments

Salesforce is going all-in on Enhanced Domains and they will be mandatory in Winter '23 (October 2022)

However, there is still no way to enable Enhanced Domains when creating a scratch org. Yes, you can manually go in and enable Enhanced Domains in Setup, but that's not a viable approach for CI/CD and automated testing scenarios.

For context: We have found several regressions in functionality when we enable Enhanced Domains in our orgs (mostly around Experience Cloud (f.k.a. Communities f.k.a. Customer Portal)) so it's imperative that we're able to cover our application with Enhanced Domains enabled when running a test suite.

I have tried pulling down the MyDomain Settings metadata and including it in the source push. This is what the metadata looks like when Enhanced Domains are enabled (i.e. after I enable it manually in Setup)

<?xml version="1.0" encoding="UTF-8"?>
<MyDomainSettings xmlns="http://soap.sforce.com/2006/04/metadata">
    <canOnlyLoginWithMyDomainUrl>false</canOnlyLoginWithMyDomainUrl>
    <doesApiLoginRequireOrgDomain>false</doesApiLoginRequireOrgDomain>
    <enableNativeBrowserForAuthOnAndroid>false</enableNativeBrowserForAuthOnAndroid>
    <enableNativeBrowserForAuthOnIos>false</enableNativeBrowserForAuthOnIos>
    <myDomainName>river-pluto-6376-dev-ed</myDomainName>
    <myDomainSuffix>MySalesforce</myDomainSuffix>
    <redirectPriorMyDomain>true</redirectPriorMyDomain>
    <use3rdPartyCookieBlockingCompatibleHostnames>true</use3rdPartyCookieBlockingCompatibleHostnames>
    <useEdge>true</useEdge>
    <useStabilizedMyDomainHostnames>true</useStabilizedMyDomainHostnames>
    <useStabilizedSandboxMyDomainHostnames>true</useStabilizedSandboxMyDomainHostnames>
</MyDomainSettings>

This is what it looks like when Enhanced Domains is NOT enabled

<?xml version="1.0" encoding="UTF-8"?>
<MyDomainSettings xmlns="http://soap.sforce.com/2006/04/metadata">
    <canOnlyLoginWithMyDomainUrl>false</canOnlyLoginWithMyDomainUrl>
    <doesApiLoginRequireOrgDomain>false</doesApiLoginRequireOrgDomain>
    <enableNativeBrowserForAuthOnAndroid>false</enableNativeBrowserForAuthOnAndroid>
    <enableNativeBrowserForAuthOnIos>false</enableNativeBrowserForAuthOnIos>
    <myDomainName>americano-latte-837-dev-ed</myDomainName>
    <myDomainSuffix>MySalesforceLimited</myDomainSuffix>
    <redirectPriorMyDomain>true</redirectPriorMyDomain>
    <use3rdPartyCookieBlockingCompatibleHostnames>true</use3rdPartyCookieBlockingCompatibleHostnames>
    <useEdge>false</useEdge>
    <useStabilizedMyDomainHostnames>true</useStabilizedMyDomainHostnames>
    <useStabilizedSandboxMyDomainHostnames>false</useStabilizedSandboxMyDomainHostnames>
</MyDomainSettings>

Notice the <useEdge>, <useStabilizedMyDomainHostnames>, and <myDomainSuffix> values are the ones that change when Enhanced Domains is enabled

In summary: Pushing the Settings metadata has no effect. It does not enable Enhanced Domains.

daveespo avatar May 03 '22 11:05 daveespo

Thank you for filing this feature request. We appreciate your feedback and will review the feature at our next grooming or sprint planning session. We prioritize feature requests with more upvotes and comments.

github-actions[bot] avatar May 03 '22 11:05 github-actions[bot]

This issue has been linked to a new work item: W-11090064

uip-robot-zz avatar May 03 '22 11:05 uip-robot-zz

I agree, this would be excellent functionality to have!

emilygdavis avatar May 17 '22 17:05 emilygdavis

This issue has not received a response in 60 days. It will auto-close in 7 days unless a response is posted.

github-actions[bot] avatar Sep 21 '22 19:09 github-actions[bot]