Change Your Users’ Login Experience with Dynamic Branding

External Identity partners and customers, you now have more control over your community’s login experience—the experience users embark on when they log in to your site. Want your logo to change on the login page depending on whether the user is an employee or customer? Or how about displaying a particular self-registration page based on the user’s country code. Your branding changes dynamically according to who logs in and from where. This change applies to both Lightning Experience and Salesforce Classic.
Available in: Enterprise, Performance, Unlimited, and Developer Editions

Note

Note

This feature continues the work begun in Salesforce Summer '17 to support dynamic branding for login pages. In Summer '17, you could create URLs with dynamic parameters programmatically. Now you can also set dynamic parameters from the UI on the Community Workspaces Administration | Login & Registration setup page.

We often use “login experience” instead of “login page” to refer to the complete login exchange. A login experience refers to the initial login page plus any secondary pages that you add to customize login. For example, you can add 2FA authentication, Terms & Conditions, or a login flow.

What’s dynamic branding? You’ve been able to modify the login page’s branding options: logo, background color, and right-frame URL. Now you can customize the branding dynamically depending on certain conditions like who the user is or where the user is logging in from.

For example, the Universal Distributing company admin wants to brand the login page depending on whether the user is an internal employee or external customer or partner. The login page for each type of user has a different logo and right-frame URL. Both groups are served from the same Visualforce login page.

Two login pages one for external and internal

If you use the default login page, you can supply different logos and right-frame URLs dynamically. If you have a custom login page, you use Visualforce and Apex controllers to implement any dynamic login experience, including setting logos, right-frame URLs, and background colors.

When users log in, the URL contains the experience ID parameter {expid}. The Experience ID value stored in a browser cookie determines what the user experiences. For example, this logo contains the {expid} parameter, https://universaldistributing.com/{expid}_logo.png.

If the value of the experience ID is internal, {expid} becomes internal_logo.png at runtime.

https://universaldistributing.com/internal_logo.png

internal logo

If the value of the experience ID is external, {expid} becomes external_logo.png.

external logo

For the default login page, you specify the experience ID parameter to your URLs from the Community Workspaces or Community Management Administration | Login & Registration page.

Dynamic login & registration page

For the dynamic custom login page, you use Visualforce and the Apex System.Site class methods getExperienceId and setExperienceId.

You can also set extend the following endpoints with the expid value.

  • community-url/services/oauth2/authorize/expid_value
  • community-url/idp/endpoint/HttpPost/expid_value
  • community-url/idp/endpoint/HttpRedirect/expid_value
  • community-url_login_page?expid={value}
  • community-url/CommunitiesSelfReg?expid={value}
  • secur/forgotpassword.jsp?expid={value}

This dynamic branding feature applies to all login pages. A default login page supports dynamic logos and right-side URLs. A Lightning login page supports dynamic logos. With a custom login page, you can implement whatever dynamic experience you choose.