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
Danny_SDanny_S 

API & Self Service Session

Hi,
 
I want to validate a self service portal session , But can't understand if it's possiable.
 
I want to place in a case page on the SSP a link to my php application on my remote server, I'm passing to it the session id , so the php will authenticate the session using API without requring the user to relogin.
 
 
evgenykaevgenyka
Hi
Did you success to do that
I am looking for same solution
KevinPAKevinPA
I believe you can authenticate the session by including the ssp sessionid in the soap header then make a request to the server such as getServerTimestamp(). You should only be able to do that with a validated session, which you should already have from the ssp.

php example (you'll need to set $session with the session id from ssp):

Code:
try
{
 $sforceReq = new SoapClient("sforce.wsdl");
   
 //Set the sessionid in the header
 $sforceReq->__setLocation('https://na3-api.salesforce.com/services/Soap/c/10.0');
 $sforce_header = new SoapHeader('urn:enterprise.soap.sforce.com', 'SessionHeader', array('sessionId' => $session));
 $sforceReq->__setSoapHeaders(array($sforce_header));
 
//send a request with the session id from ssp. $userinfo = $sforceReq->getServerTimestamp(); //do some stuff now bc if we get past the server request, we have a validated session } catch (Exception $e) { echo $e; }