Start tracking your progress
Trailhead Home
Trailhead Home

Customize Your Login Process with My Domain

Learning Objectives

After completing this module, you’ll be able to:
  • Understand how a custom domain provides more control over your login process.
  • Customize your domain name, URL, and login page.

Customize Your Salesforce Org URL with My Domain

Ever find yourself wanting to tweak the out-of-the-box Salesforce login experience for your users? For example, add your company name to the login URL? Show your logo on the login page? Let your users log in with their Google credentials? My Domain lets you do all this and more.
My Domain URL

What Is My Domain?

My Domain is sort of like creating your own empire within the Salesforce universe. It’s a Salesforce Identity feature that lets you personalize your Salesforce org by creating a subdomain (empire) within the Salesforce domain (universe).

How’s that? Your users access your org through the instance URL that Salesforce assigns you, such as . With My Domain, you give your users a nifty, personalized way to access Salesforce. Instead of the meaningless URL, your URL can look like, where:

  • somethingReallycool 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.


Even though technically you’re creating a subdomain, it’s sometimes referred to as creating a My Domain. Also you might see a My Domain subdomain referred to as a “custom” domain but “custom” has a specific meaning for Salesforce. Custom domain URLs end with your domain name such as instead of . This subject is for another day.

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
  • Let’s view this video to get a brief overview of setting up your subdomain with My Domain.

My Domain Versus Trailhead Playgrounds

Did you catch that part in the video about Trailhead Playgrounds? When you begin a hands-on challenge in Trailhead, the first thing that happens is that you create a Trailhead Playground. And that Playground is set up as a My Domain subdomain. Look at the browser’s address bar for the name of the Playground (which is actually a My Domain subdomain). All Playground subdomains start with a cute animal name and some random numbers to ensure uniqueness. The subdomain ends with -dev-ed, which means that the subdomain is a Salesforce Developer Edition org. In this Trailhead Playground, the subdomain, https://cunning-panda-e4smb1-dev-ed is a subdomain within the Salesforce domain.

Name of Trailhead Playground appears in browser address bar

You can have several Playgrounds and can manage them within Trailhead. To list your Playgrounds, from any hands-on challenge, click a Playground name.

Manage playgrounds from hands-on challenge

To manage your Playgrounds, you click Manage my hands-on orgs. This ambitious Trailblazer has eight Playgrounds. Notice that among the list of Playgrounds is a Developer Edition org. We explain why next.

List of Trailhead Playgrounds

To learn a lot more about Trailhead Playgrounds, see Trailhead Playground Management.

Create a My Domain

In this module, you create a My Domain subdomain in the hands-on challenge. But there’s a catch. You can’t create a subdomain within a subdomain. So you can’t use a Trailhead Playground. Instead, you sign up for a production Salesforce Developer Edition org. Go to the sign-up page, and enter your own email address. For the username, make up a fictitious name that looks like an email address, such as . You soon get an email with a link to your org. Click Verify Account, create a password, and you’re logged in to your very own Developer Edition org.

The address bar shows that your new org uses an instance URL, such as . Now you’re ready to replace that instance URL with your own subdomain.

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, 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.

  1. From Setup, enter My Domain in the Quick Find box, then select My Domain.
  2. Enter the name for your subdomain. Choose something fun that’s also unique. Enter your custom domain nameHere you see that our subdomain name is jedeye-tech (1). Salesforce supplies the rest of the domain name (2). Because we’re using a Trailhead Playground, the domain name is Your production org has the suffix.
  3. Click Check Availability. Salesforce checks whether this domain name is already in use. My Domain accept terms and register custom domain
  4. When you get the green light (3), click Register Domain (4).
  5. 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.


Your subdomain is usually ready in a few minutes, but can take up to 24 hours. Be assured—your personal empire is on its way.

Test and Deploy Your Subdomain

Did you get your activation email? Look for an email with a subject like, “Salesforce domain ready for testing.” Now let’s finish setting up your subdomain and rolling it out to your users.
  1. From the email you receive, click the link to get back to the My Domain wizard. Email message with the link to the new My Domain subdomain
  2. The link takes you to your Salesforce org. Notice the URL in the browser address bar shows your new subdomain name. Custom domain URLRight 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 Since we haven’t customized our org, we know it doesn’t have any faulty URLs. So we can go on. But 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.
  3. Click Log in to continue setting up My Domain. Enter the username and password you used when you signed up for your org.
  4. Pretend that we’ve completed testing links. It’s time to make your subdomain available to all the users in your org.
  5. 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.
    Note: This step is often overlooked, especially when you’re interrupted while working on this module. If you walked away, get yourself back to My Domain. From Setup, enter My Domain in the Quick Find box, then select My Domain. Salesforce takes you to the step in the My Domain wizard where you left off. If you’re still at Step 3, click Deploy to Users.
  6. 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.

After Deployment: Set My Domain Policies

Did you notice that a new section appeared in your My Domain Setup page when you deployed your subdomain to all users? It’s called My Domain Settings and it gives you some more control over how your subdomain is used. Let’s take a look.
  1. If you’re not looking at the My Domain page, from Setup, enter My Domain in the Quick Find box, then select My Domain.
  2. 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. My Domain login settings
  3. 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 URL. Redirect PolicyYou can choose between three redirect policies. That is, if someone selects a bookmark such as, 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.
  4. Rename your My Domain Lets you rename your My Domain, for example, if your company’s name or branding changes.

Customize and Deploy Your Login Page

You’ve created your My Domain subdomain. You’ve set your subdomain’s login policies. Now you’re ready to make your login page your own. Brand your login page to help your users recognize your site without having to squint at the URL in the browser bar.

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.

Custom login page
  1. If you’re not looking at the My Domain page, from Setup, enter My Domain in the Quick Find box, then select My Domain.
  2. Under Authentication Configuration, click Edit. If you’re asked for it, grant permission to open Authentication Configuration in a new tab. Login page set up
  3. 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.
  4. For Background Color, change the background color of your login page—either enter a hexadecimal color code or click the color picker Select a color from color picker.
  5. 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, you can enter the URL for one of our stock pictures:
  6. Don’t change Login Page Type now. This option comes into play when you want to change how users log in. For now, we’re staying with the standard username and password.
  7. Click Save.
  8. Log out and try to log in again. You’re greeted with your new login page.
Sample login page

You’re Done!

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.