📢 Attention Salesforce Certified Trailblazers! Maintain your credentials and link your Trailhead and Webassessor accounts by April 19th. Learn more.
close

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 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:

somethingReallycool
Equals your personal subdomain within the Salesforce domain. Typically, it's your company name or whatever drives your brand.
.my.salesforce.com
Is the Salesforce domain name—domain, for short. My Domain URLs all belong to this same domain.
Note

Note

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 mycompany.com instead of salesforce.com. 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

Sign Up for a New Developer Edition Org

Before you continue with this module, sign up for a new Developer Edition org. Why? Good question. Configuration changes made for these exercises can impact your other Trailhead modules and projects.

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.

  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 name

    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.

  3. Click Check Availability. Salesforce checks whether this domain name is already in use.
  4. My Domain accept terms and register custom domainWhen 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. Don’t worry if the process takes a few minutes. 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, 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. Custom domain URL

    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.

  2. Click Log in to continue setting up My Domain.
  3. Pretend that we’ve completed testing links. It’s time to deploy your subdomain to your users.
  4. 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

    Note

    This step is often overlooked, especially when you’re interrupted while working on this module. To check, from Setup, enter My Domain in the Quick Find box, then select My Domain. Salesforce takes you to the current step in the My Domain wizard. If you’re still at Step 3, click Deploy to Users.

  5. 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 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.
    Rename your My Domain
    Let’s 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: https://mydomain-sample.herokuapp.com.
  6. Don’t change Login Page Type or Login Form now. These options come 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 you see the 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.

retargeting