- User Experience: Users only see the login methods relevant to their organization or status.
- Security and Privacy: Each login option is private to the intended group.
- Customization: Easily adaptable to future changes or additional user groups.
Modern Salesforce Community sites often host users from multiple groups—customers, internal employees, and various partners. Each group may require a unique authentication process, but how do you ensure users only see the Single Sign-On (SSO) options relevant to them, while keeping other login methods hidden?
This post explores a customizable solution implemented with a Lightning Web Component (LWC), allowing you to dynamically display or hide SSO and password login options based on the user’s email address input. This approach ensures a streamlined, private, and user-tailored login experience on your Salesforce portal.
Imagine you want regular customers to log in with a simple username and password, while employees and partners must use SSO. Further, suppose you want specific SSO providers to be available exclusively to specific partners, so that no user can see login options intended for another group. The default Salesforce login page does not support this granularity out of the box.
A Lightning Web Component was developed to solve this challenge. Here’s an overview of the end-user experience:
[email protected]), the page detects that they should log in with a password. The password field appears, and there is no SSO option visible.private or matching a company domain), the component dynamically hides the password field and displays only the relevant SSO button. Other SSO providers remain hidden from view.This privacy-focused approach ensures organization-specific login flows remain confidential and relevant to each user.
The custom LWC is added to your portal’s login page. It listens as users type their email address:
An Apex class complements the LWC, handling authentication logic based on whether the user is logging in with a password or via SSO.
From my initial call with Spencer through project implementation with John and Evan, my experience with the SOLVD team was excellent. They were quick to understand our business needs, clear when explaining the reasoning behind proposed solutions, transparent when reporting on progress and timeline, and all around enjoyable to work with. Would highly recommend and looking forward to continue working with them in the future!
SOLVD was very straight forward with everything needed to complete the project. No surprises, no issues, and cost was aligned with the estimate. They made implementation easy and quick.
As a rule, I'm pretty stingy with my recommendations. So it's a pleasure for me to recommend Solvd as a top-flight Salesforce consultancy. Solvd recently led our company's conversion to the Lightning interface and did it on time, on budget and made it easy for me and my team. I know I'll use their services again, and am confident they can do the same for you.
Start Automating Today