function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Srinivasan K R 13Srinivasan K R 13 

Experience cloud login with email instead of username

Hi all, 

I want to expose the login, forgot password screens to accept user email instead of username on my experience cloud sites. I looked at the default controllers for login, forgot password & query for username matching the email provided. I then trigger standard Site methods like login(username) & forgotpassword(username). I can't seem to get it working. Any help will be great.

AbhinavAbhinav (Salesforce Developers) 
Hi Srinivasan,

Use Login Discovery to Simplify Login

If you want your customers and partners to log in with another identifier than their username, such as a phone number or email address, configure your site with the Login Discovery Page. After users enter the identifier, they are challenged to verify themselves. For example, they are prompted to enter a verification code sent via email or text. If the user correctly enters the code on the Verify page generated by Salesforce, the user is logged in to your site. If SSO-enabled, Login Discovery can send the user directly to the identity provider login page. With Login Discovery, users can identify themselves using an email address or phone number. It also supports custom identifiers, such as an employee number or federation ID, in Apex.

Check this for detail:

https://developer.salesforce.com/docs/atlas.en-us.externalidentityImplGuide.meta/externalidentityImplGuide/external_identity_login_discovery_create_discovery.htm

Thanks!
Julian LeahJulian Leah
I had no idea multiple users can log in. Multiple users can't even login at https://technicalustad.com/problems-do-first-year-students-have-in-college/. So all in all, I'm rather surprised it's the case here.