After completing this module, you will be able to:
- Explain the benefits of My Domain.
- Explain how My Domain allows you to control how users access your Salesforce org.
- Customize your login page.
Customize the URL of the Salesforce org with My Domain
Have you ever wanted to tailor the Salesforce login experience for your users? For example, add your company name to the login URL? Show your logo on the login page? Allow users to sign in with their Google credentials? My domain allows you to do all this and much more.
What is My domain?
Let’s watch this video to learn more about My Salesforce Domain.
My domain is somewhat similar to creating your own empire in the Salesforce universe. It is a feature of Salesforce Identity that allows you to customize your Salesforce org by creating a subdomain (empire) in the Salesforce domain (universe).
How is that? If your Salesforce org was created before Winter ’21, your users access your org using the instance URL that Salesforce assigns them, such as https://na30.salesforce.com. With My Domain, you offer your users a useful custom method of accessing Salesforce. Instead of the irrelevant URL https://na30.salesforce.com, your login URL may look like https: //somethingIsVeryGood.my.salesforce.com where:
- Something That Is Very Good is the same as the name of your My Domain: your personal subdomain within the Salesforce domain. Typically this is your company name or anything else that enhances your brand.
- my.salesforce.com is the Salesforce domain name (domain for short). All My Domain login URLs belong to this same domain.
Although you are technically creating a subdomain, this is sometimes referred to as My Domain creation. Also, you might see a My Domain referred to as a “custom” domain, but “custom” has a specific meaning for Salesforce. Custom domain URLs end with your domain name such as mycompany.com instead of salesforce.com. This matter is for another time.
Having a My Domain is not limited to the usability and branding of an organization’s login experience. It is related to greater control of the login process and simplification of authentication. In fact, Salesforce requires you to have a My Domain for the following:
- Work across multiple Salesforce orgs with the same browser.
- Configure single sign-on (SSO) with external identity providers.
- Configure authentication providers , such as Google and Facebook, so that users can log into your Salesforce org with their social account credentials.
- Use Lightning Components in Lightning Component tabs, Lightning Pages, in the Builder of Lightning applications or in standalone applications
- Use Financial Services Cloud, Health Cloud or Work.com
Does your organization have a My domain?
Because having a My Domain is so important, all Production and Developer Edition orgs created in Winter ’21 and later receive one by default. All organizations will have to implement one in winter 2022.
If your production org doesn’t have a My Domain yet, don’t worry. Setting one up is simple. To access the instructions, go to My domain in Salesforce Help.
In this unit we focus on defining My Domain policies and customizing your organization’s login page. In both cases it is necessary to have My Domain, so if you want to continue with the unit, you must use a Trailhead Playground which, as you will see below, already has a My Domain.
My domain versus Trailhead Playgrounds
Did you catch the part in the video about Trailhead Playgrounds? When you start your first hands-on challenge in Trailhead, you must create a Trailhead Playground. Also, that Playground has a My domain.
Take a look at the browser’s address bar to find the name of the Playground. All Playground My Domain names start with the name of a funny animal and some random numbers to ensure exclusivity. My domain name ends with -dev-ed, which means that the My domain is for a Salesforce Developer Edition org.
In this Trailhead Playground, My domain name creative-raccoon-b6c0h0-dev-ed, is a subdomain in the Salesforce domain lightning.force.com.
For more information about Trailhead Playgrounds, see Management by Trailhead Playground .
Do you want to go to practice with My domain?
In this unit, we’ll walk you through the steps to configure your My Domain policies and customize your Salesforce login page. We don’t have a hands-on challenge in this unit, but if you want to go ahead and test the steps, here’s how to start your Trailhead Playground.
- First, make sure you are logged into Trailhead.
- Click on your user avatar in the upper right corner of this page and select Internship Organizations from the drop-down menu.
- Click Start next to the organization you want to open. Or, if you want to create a new playground, click Create Playground .
Set My domain policies
When you have a My Domain, a section will appear on your My Domain setup page. It’s called Policies and it allows you to have more control over how your My Domain is used.
Let’s imagine this scenario. Suppose you are a Salesforce administrator for Jedeye Technologies. You already have a My domain name implemented: jedeyetech. With this My Domain, your org has a branded login URL, https://jedeyetech.my.salesforce.com, and all of your Lightning pages use https://jedeyetech.lightning.force.com/. ;
Your marketer is very pleased to have the branding in the URLs. She doesn’t want users to see her org’s Salesforce instance in their browser’s address bar. You want to give your users some time to update their bookmarks.
- Under Settings, enter My Domain in the Quick Find box, then select My Domain .
- Under Policies, click Modify .
- Login Policy : You can require users to login using your My Domain login page. Leave this option unchecked. We still want users to be able to log in from https://login.salesforce.com.
- Redirect Policy – Control what happens when users try to use instance URLs from your organization instead of My Domain URLs. For example, when a user visits a bookmark https://na139.lightning.force.com/lightning/page/home instead of their organization’s equivalent My Domain URL, https://jedeyetech.lightning.force.com / lightning / page / home.
You can choose from three redirect policies. Before we change anything, let’s look at the different options.
- Redirected to the same page within the domain – Allow users to continue accessing your org from Salesforce instance URLs, plus de from My domain URLs with the. This option can be useful, but it will not force your users to access your organization with the mark.
- Redirected with a warning to the same page within the domain : reminds the users using their My Domain URLs before redirecting them to your organization. This can help change user behavior to help transition to branded URLs. Considering the goals in the Jedeyetech scenario, this seems to be the best option.
- Do not redirect (recommended) – requires users to use their home URL My Domain session when accessing your organization. Using this parameter assumes that your users have already transitioned to the new My Domain URLs. If they haven’t already, they’ll get an error when trying to use your org’s Salesforce instance URLs.
- Eventually we’ll want to force everyone to use them. Jedeye Tech branded My Domain URL. But for now, we want to give our users some time to update their bookmarks. Therefore select the redirection policy Redirected with a warning to the same page within the domain .
- Click Save .
It’s good to use this option for a few days to help users transition to your organization’s My Domain URLs. You can then update My Domain again to use the recommended redirect policy: Do not redirect.
When you rename your My Domain, Salesforce will redirect the URLs from your old My Domain to the new My Domain. For example, if you change the name of your My Domain from jedeyeinc to jedeyetech, requests sent to https://jedeyeinc.lightning.force.com will automatically be redirected to https://jedeyetech.lightning.force.com. The redirection policy of My Domain does not affect this redirection in any way. If you don’t want requests sent to your old My domain to be redirected, see Remove Your Previous My Domain in Salesforce Help.
Customize your login page
You have a My domain. You have set your login policies. You are now ready to create your login page. Include branding on the login page so that users recognize your website without having to search for the URL in the browser bar.
You can bookmark your login page to add a company logo, change the background, and replace the right side with your own image or message. This area is useful for making announcements that you want users to see when they log in.
- If you are not viewing the My Domain page, under Settings, enter My Domain in the Quick Find box, then select My Domain .
- Under Settings authentication, click Modify .
- Do not change the type of login page. This option kicks in when you want to change how users log in. For now, we stick with the standard username and password.
- For Logo File, upload an image of your company logo. The logo appears at the top left of the login page. Images can be .jpg, .gif, or .png files up to 100 KB. The maximum image size is 250 by 125 pixels wide.
- For Background Color, change the background color of your login page, either by entering a hex color code or by doing click on the color picker
- To update the content on the right side of the login page, specify a URL from the right frame. The content is designed to be resized so that it fills about half the page. In your production org, you enter the URL of a file hosted on an SSL-encrypted URL and the https: // prefix. For now, you can enter the URL for one of our available images. https: / /mydomain-sample.herokuapp.com .
- Do not touch the authentication methods. Do not select the options to use the native browser for user authentication on iOS or Android. These options support authentication methods such as delegated authentication or certificate-based authentication for Mobile SDK and Salesforce app users on mobile devices. For more information, see Mobile SDK Development Guide. These options have no effect on the appearance of the branding on your organization’s login page, so we will not change them.
- Click Save .
- Log out and try logging in again. You are welcomed with our new login page.
You are done.
Congratulations, administrator! You have set your My Domain redirect policy and have adapted your login page to reflect your company brand. Your marketer is pleased that your Salesforce org reflects your brand.