Customize Your Login Process with My Domain
- Understand how a custom domain provides more control over your login process.
- Customize your domain name, URL, and login page.
How’s that? Your users access your org through the instance URL that Salesforce assigns you, such as https://na30.salesforce.com. With My Domain, you give your users a nifty, personalized way to access Salesforce. Instead of the meaningless https://na30.salesforce.com URL, your URL can look like, https://somethingReallycool.my.salesforce.com where:
- Equals your personal subdomain within the Salesforce domain. Typically, it's your company name or whatever drives your brand.
- Is the Salesforce domain name—domain, for short. My Domain URLs all belong to this same domain.
Having a My Domain subdomain isn’t just about convenience and branding an org’s login experience. It's about having more control over your login process and simplifying authentication. In fact, Salesforce requires you to have a My Domain subdomain in place to:
- Work in multiple Salesforce orgs in the same browser
- Set up single sign-on (SSO) with external identity vendors
- Set up authentication providers, such as Google and Facebook, so that your users can log in to your Salesforce org with their social account credentials
- Use Lightning components in Lightning component tabs, Lightning page, the Lightning App Builder, or standalone apps
When you’re signing up for a new Developer Edition org, enter your usual email address. For the username, make up a fictitious name that looks like an email address, such as yournameDE@salesforce.com.
All set? Let’s view this video to get a brief overview of setting up your subdomain with My Domain. Creating your subdomain using My Domain can sound complicated, but it’s not.
Now that you’re equipped and ready to go, let’s imagine this scenario. Suppose you’re a Salesforce admin for Jedeye Technologies. Your chief security officer has an end-of-year goal to let users securely log in to your org with their Google credentials. Before that can happen, you need to create a Salesforce subdomain with My Domain. So let’s set one up.
In our example, we’re going to use jedeye.tech, an obvious choice given our company name. When you’re creating a subdomain for your production org, work with stakeholders to determine the name before setting it in stone. Get sign-off from the right executives before moving forward.
- From Setup, enter Domain in the Quick Find box, then select My Domain.
- Enter the name for your subdomain. Choose something fun that’s also
Here you see that our subdomain name is jedeye.tech (1). Salesforce supplies the rest of the domain name (2). Because we’re using a DE org, the domain name is -dev-ed.my.salesforce.com. Your production org will have the my.salesforce.com suffix—without the -dev-ed.
- Click Check Availability. Salesforce checks whether this domain name is already in use.
- When you get the green light (3), click Register Domain (4).
- Sit back and watch for an email telling you that the process completed. Behind the scenes, Salesforce prepares your subdomain and updates its domain name registries. Don’t worry if the process takes a few minutes. Be assured—your personal empire is on its way.
- From the email, click the link to get back to the My Domain wizard. It
takes you to your Salesforce org. Notice the URL in the browser
address bar shows your new subdomain name.
Right now, you’re the only one who has this URL. Before you roll out the subdomain to your users, you must check that the links in your org all lead to your subdomain URL. Why wouldn’t they? If your Salesforce admin customized your org, such as adding custom buttons or Visualforce pages, the org can have hard-coded references. Hard-coded references are links that contain your instance name, such as https://na30.salesforce.com.
Since we haven’t customized our org, we know it doesn’t have any faulty URLs. So we can go on. When you’re setting up your subdomain on a production org, you can learn more about faulty URLs. Search for the KB article, “Updating Hard-Coded References” in Salesforce Help.
- From Setup, enter Domain in the Quick Find box, then select My Domain.
- If enabled, click Log in and log in again.
- Pretend that we’ve completed testing links. It’s time to deploy your subdomain to your users.
- Click Deploy to Users, and then click
OK. Deploying a subdomain rolls out the new subdomain URL throughout your org. Now all your users see the subdomain URL in their browser address bar.
- Click OK.
Now that the subdomain is deployed, notice that the page displays more configuration options. Let’s continue configuring it. Next up, set your login policies.
- If you’re not looking at the My Domain page, from Setup, enter My Domain in the Quick Find box, then select My Domain.
- Under My Domain Settings, click Edit.
Set login policies to control what happens when users try to log in from your old URL instead of from My Domain.
- For now, keep the default settings, but let’s review the options.
- Login Policy
Requires users to log in using your subdomain login page. It prevents users from attempting to log in with the generic https://login.salesforce.com/ URL.
- Redirect Policy
You can choose between three redirect policies. That is, if someone selects a bookmark such as https://na30.salesforce.com, we redirect them to the subdomain equivalent.
- Redirect to the same page within the domain. Lets users continue to log in from your URL as well as your subdomain name. This option might be convenient, but it’s like nothing has changed.
- Redirected with a warning to the same page within the domain. Reminds users to use your subdomain name when logging in. Yet it still redirects them to your org. This option is good for a few days after you deploy your subdomain to help users transition to your new subdomain name.
- Not redirected. Requires users to use your subdomain name when accessing your org. The training wheels are off. Expect that your users have transitioned to using the subdomain URL. If they haven’t, they get an error when they try to use your instance URL instead of the subdomain URL.
You can brand your login page to add a company logo, change the background, and replace the right side with your own picture or message. This area is useful for making announcements that you want users to see as they log in.
- If you’re not looking at the My Domain page, from Setup, enter Domain in the Quick Find box, then select My Domain.
- Under Authentication Configuration, click Edit.
If you’re asked for it, grant permission to open Authentication
Configuration in a new tab.
- Upload an image for your company logo. The logo displays 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.
- Change the background color of your login page—either enter a hexadecimal color code or click the color picker .
- Update the content of the right side of the login page. The content is designed to resize to fill about half of the page. On your production org, you enter the URL of a file that’s hosted at a URL using SSL encryption and has the https:// prefix. For now, enter the URL for one of our stock pictures: https://mydomain-sample.herokuapp.com.
- Keep Login Page selected for now. This option comes into play after you’ve configured single sign-on or authentication providers, such as Google and Facebook.
- Click Save.
- Log out, and you see the new login page.
Congratulations administrator! You’ve set up a subdomain with My Domain. And you’ve tailored your login page to reflect your company’s branding. Your chief security officer will be pleased that you’re closer to the end-of-year goal of allowing users to log in with Google credentials.