Skip to main content
Build the future with Agentforce at TDX in San Francisco or on Salesforce+ on March 5–6. Register now.

Customize Your Login Process with My Domain

Learning Objectives

After completing this module, you’ll be able to:

  • Explain the benefits of My Domain.
  • Detail how My Domain lets you control how users access your Salesforce org.
  • Customize your login page.

Customize Your Salesforce Org URL with My Domain

Ever find yourself wanting to tweak the 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.

What Is My Domain?

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

How’s that? With My Domain, your users get a nifty, personalized way to access Salesforce. Instead of a meaningless URL that contains your Salesforce instance, such as https://na30.salesforce.com, your login URL looks like https://somethingReallycool.my.salesforce.com where:

  • somethingReallycool equals your My Domain name: 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 suffix—domain, for short. With a couple of rare exceptions, My Domain login URLs all belong to this same domain.
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 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 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 in place to:

  • Work in multiple Salesforce orgs in the same browser.
  • Set up single sign-on (SSO) with third-party 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.
  • Customize your org's login page with your brand.

Because having a My Domain is so important, all orgs get one by default. For production orgs, if a My Domain wasn't specified during creation, your default My Domain is based on your internal Salesforce org ID. If you don't like your org's My Domain name, you can change it. Head over to My Domain in Salesforce Help for the details. 

Set My Domain Policies

The Policies section of the My Domain Setup page gives you more control over how your My Domain is used. 

Let’s imagine this scenario. You’re a Salesforce admin at Jedeye Technologies. You already have a deployed My Domain name: jedeyetech. With this My Domain, your org has a branded login URL, https://jedeyetech.my.salesforce.com, and its Lightning pages all use https://jedeyetech.lightning.force.com/. 

Your chief marketing officer is thrilled that your brand is included in your URLs. She doesn’t want your users to see your org's Salesforce instance in the address bar of their browsers.

To make sure that your My Domain policies are aligned with your company’s goals, you take a tour of the My Domain page in Setup.

  • From Setup, enter My Domain in the Quick Find box, then select My Domain.
  • Under Routing and Policies, click Edit.

My Domain policies.

  • Login Policy—For another layer of security, you can require that logins to your Salesforce org use your My Domain login URL. There are separate options for user logins and SOAP API logins. 
    • To require that users log in with your My Domain, in production, select Prevent login from https://login.salesforce.com. Or, in a sandbox, select Prevent login from https://test.salesforce.com. When you enable this setting, users also can’t use your instanced URL, such as https://na77.salesforce.com, to log in.
      Leave this option unchecked. We still want users to be able to log in from https://login.salesforce.com.
    • To require that SOAP API logins use your My Domain login URL, in production, select Prevent SOAP API login from https://login.salesforce.com. Or, in a sandbox, select Prevent SOAP API login from https://test.salesforce.com. When you enable this setting, SOAP API logins also can’t use your instanced URL, such as https://na77.salesforce.com, to log in.
      Also leave this option unchecked.
    • To return to the main My Domain Settings page, click Cancel.

Under Redirections, click Edit.

Redirections page.

You can optionally use Event Monitoring to log successful and blocked redirections for previous hostnames for the org. As you start to implement Jedeye Tech’s new, branded My Domain URLs, you want to identify requests to your old URLs so that you can update references to them. To track redirections, select Log redirections and save your changes.

After you save your changes, Salesforce generates a log for the Hostname Redirects event type. The log contains information about redirections for the last 24 hours at the time that the background process generates the file. For more information about logging, see Log My Domain Hostname Redirections in Salesforce Help.

Note

Some orgs have different redirection settings available. For more information, see Manage My Domain Redirections in Salesforce Help.

Customize Your Login Page

You’ve set your My Domain 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 look 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.

Under Authentication Configuration, click Edit.

My Domain authentication configuration options.

  1. Don’t change Login Page Type. This option comes into play when you want to change how users log in. For now, you’re staying with the standard username and password.
  2. 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.
  3. 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.
  4. To update the content of the right side of the login page, specify a Right Frame URL. The content is designed to resize to fill about half of the page. In 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 a stock photo from Lorem Picsum.
  5. Leave the authentication methods alone. Don’t select the options to use the native browser for user authentication on iOS or Android. These options support authentication methods such as delegated authentication to certificate-based authentication for users of Salesforce and Mobile SDK applications on mobile devices. To learn more, see the Mobile SDK Development Guide. These options have no effect on the branding of our org’s login page, though, so we won’t change them.
  6. Click Save.
  7. Log out and try to log in again. You’re greeted with your new login page.

Sample login page.

You’re Done!

Congratulations, admin! You’ve set your My Domain redirect policy, and you’ve tailored your login page to reflect your company’s branding. Your chief marketing officer is pleased that your Salesforce org reflects your brand.

Resources

Share your Trailhead feedback over on Salesforce Help.

We'd love to hear about your experience with Trailhead - you can now access the new feedback form anytime from the Salesforce Help site.

Learn More Continue to Share Feedback