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
GÜNES AdminGÜNES Admin 

LWC: How to validade username and password against SF credentials?

Hello Developers!

In my custom object LWC, when certain critical action is requested such as "cancel record", I want the user to provide their SF credentials, as eSignature, which is then recorded as audit trail.

I already know how to prompt for the username and password!

My Question is:
How to I check the on-screen captured username and password, validate them against the user's SF login credentials?

Thanks,
Adrien
Hitesh chaudhariHitesh chaudhari
  • As per my understanding, You cannot get the password but you can get the user easily by  UserInfo.getUserId().
  • As you want to validate user details you can use OTP functionality by sending OTP via Email using an Email alert of SMS like Twilio, or messagebird.
  • Using UserInfo.getUserEmail(); you can get email of current login user.
  •