Newer Version Available

This content describes an older version of this product. View Latest

MyDomainSettings

Represents your org’s My Domain settings. With My Domain, you can include your company name in your URLs, for example, https://yourcompanyname.my.salesforce.com. Because having a My Domain is more secure, some Salesforce features require it. Production orgs created in Winter ’21 and later have a My Domain by default. This type extends the Metadata metadata type and inherits its fullName field.

File Suffix and Directory Location

MyDomainSettings values are stored in a single file named MyDomain.settings in the settings directory. The .settings files are different from other named components because there’s only one settings file for each settings component.

Version

MyDomainSettings components are available in API version 47.0 and later.

Fields

Field Name Field Type Description
canOnlyLoginWithMyDomainUrl boolean If true, users must use the org's My Domain login URL to log in. If false (default), users can also log in using the org’s instance Salesforce URL, https://InstanceName.salesforce.com, and through the login URL https://login.salesforce.com.
doesApiLoginRequireOrgDomain boolean If true, users must use the org’s My Domain login URL to access the Salesforce API. If false (default), users can also access the Salesforce API using the generic Salesforce page, https://InstanceName.salesforce.com and through the login URL https://login.salesforce.com.
enableNativeBrowserForAuthOnAndroid boolean If true, use the native browser for authentication of Android mobile apps. Default is false.
enableNativeBrowserForAuthOnIos boolean If true, use the native browser for authentication of iOS mobile apps. Default is false.
myDomainName string The subdomain name used in My Domain URLs for this org, such as MyDomainName.my.salesforce.com and MyDomainName.lightning.force.com.

This field is read-only in the API. You can change your org’s My Domain name from the My Domain Setup page.

Available in API version 51.0 and later.

myDomainSuffix OrgDomainProdSuffix (enumeration of type string) The domain suffix for this org’s My Domain login URL. This field is read-only in the API. You can change your My Domain suffix from the My Domain Setup page.
Possible values are:
  • CloudforceLimitedcloudforce.com
  • DatabaseLimiteddatabase.com
  • MySalesforcemy.salesforce.com with enhanced domains
  • MySalesforceLimitedmy.salesforce.com without enhanced domains
  • OrgLevelCertificateLimitedmy-salesforce.com
  • Restricted1—Reserved for future use.

Available in API version 51.0 and later.

use3rdPartyCookieBlockingCompatibleHostnames boolean Indicates whether the org’s instance name is included in Visualforce URLs when third-party cookies are blocked (true) or not (false). This field has a default value of false. Setting this field true prevents potential issues loading Visualforce pages with stabilized URLs.

Only applicable when useStabilizedMyDomainHostnames is set to true and myDomainSuffix is set to MySalesforceLimited, CloudforceLimited, or DatabaseLimited.

Available in API version 51.0 and later.

If enhanced domains are enabled in your org, your URLs are different and this setting has no effect. For details, see My Domain URL Formats in Salesforce Help.

Note

useEdge boolean Indicates whether this org’s qualifying My Domain URLs are routed through Salesforce Edge Network (true) or not (false). This field has a default value of true.

This field is read-only in the API. If your org can use Salesforce Edge Network, you can enable this setting from the My Domain Setup page. After this field is set to true from Setup, it can't be set to false.

Available in API version 51.0 and later.

useStabilizedMyDomainHostnames boolean Indicates whether the instance name is hidden in My Domain URLs for Visualforce, Experience Builder, Site.com Studio, and content files (true) or not (false). This field has a default value of true. For example, MyDomainName--PackageName.na44.visual.force.com becomes MyDomainName--PackageName.visualforce.com when this field is set to true.

If enhanced domains are enabled in your org, your URLs are different and this setting has no effect. For details, see My Domain URL Formats in Salesforce Help.

Note

useStabilizedSandboxMyDomainHostnames boolean This field corresponds to the Stabilize the Hostname for My Domain URLs in Sandboxes release update, which was enforced in Summer ’20.

When true, the instance name is hidden in My Domain URLs for sandboxes orgs. For example, MyDomainName--test.cs5.my.salesforce.com became MyDomainName--test.my.salesforce.com. As of API version 49.0, this field's value is always true, regardless of the value that you set. Changing its value has no effect on Salesforce, even if it reads false.

This change applies retroactively back to API version 47.0, when this field was first introduced. Previously, in API version 47.0 to 49.0, this field indicated whether the instance name was hidden in My Domain URLs for sandboxes orgs (true) or not (false), and the field's default value was false. Now, in all API versions, this field's value is always true, even if it reads false.

Declarative Metadata Sample Definition

The following is an example of a MyDomainSettings component.

The following is an example package.xml that references the previous definition.