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
Arnaud CombesArnaud Combes 

Site.login from Webservice

Hello,

I have created a webservice (SOAP) of an Apex class, and in this class I call Site.login :

String startUrl = System.currentPageReference().getParameters().get('startURL');
 return Site.login(username, password, startUrl);

The problem is that Site.login return NULL. 
I think that it is because "System.currentPageReference()" is maybe unknown as it is called from an external tool.

Is there a way to call this function from an external website ?

For information, I try to connect with a community account (with a Salesforce account it works)...

Thank you.

Regards,