+ Start a Discussion
Arnaud CombesArnaud Combes 

Site.login from Webservice


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.