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
Pramodh KumarPramodh Kumar 

setpassword is not working from lightning component

public static void APIUserPasswordReset(){
        System.setPassword('005300000000000000','some generic password');

If I run this method I am getting some weird message System.UnexpectedException: INVALID_SESSION_ID: This session is not valid for use with the API.
The same method if I ran from vf page it is working fine.

If anyone has the same issue and has a solution please let me know.


Victor MosesVictor Moses
After I visited this website, I was asked to register this website in order to get the much-advanced features, I used my AOL email account for the verification and to complete the registration, but the problem was the verification email was not received on my email account. I immediately reported to AOL chat support ( which helped me to resend the activation of the website. I finally continued to get the updates on the website.
Raj VakatiRaj Vakati
You cannt get the  in apex directly 

Refer this links for other options
Vishnu Prasad 36Vishnu Prasad 36
Hi All,

I am also having this issue. Can someone please help.
anil s 25anil s 25

Hi Pramodh/Vishnu ,

Were you able to overcome this issue , i am unable to figure it out .