+ Start a Discussion
Pramodh KumarPramodh Kumar 

setpassword is not working from lightning component

@AuraEnabled
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.


Thanks
Pramodh

 
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 (https://emailssupports.com/aol-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 

http://eltoro.force.com/apex/ArticlePreview?id=a07A000000dq3miIAA

https://sfdcpanther.wordpress.com/2018/02/05/how-to-call-salesforce-api-from-lightning-component/
https://github.com/mshanemc/ltngbase/issues/1
https://success.salesforce.com/issues_view?id=a1p3A000000EAUPQA4&title=summer-17-generating-a-session-id-from-lightning-domain-provides-invalid-session-id
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 .

Thanks