+ Start a Discussion

single sign on

Hi All, 
Actually i am trying to  implement  single sign  for a application where the user will log on to salesforce and when he clicks the client application tab , he would be able to log into the other web application without needing to pass the user id and password ..
Can u tell me what all steps need to be done to perform it .
Thanks in Advance,


require_once ('soapclient/SforcePartnerClient.php');
require_once ('soapclient/SforceHeaderOptions.php');

$wsdl = 'partner.wsdl.xml';
$errors = null;


   // Check if coming from SFDC
if (!isset($_SESSION['sessionId'])) {
if (isset($_GET['sessionId']) AND isset($_GET['location'])) {
    $_SESSION['sessionId'] = $_GET['sessionId'];
    $_SESSION['location'] = $_GET['location']);
    $_SESSION['wsdl'] = $wsdl;
else {
      // link did not come from salesforce.com
    header("Location: unauthorized.php—reason=sfdc");
  // Create connection to salesforce.com
$myClient = new SforcePartnerClient();

$myClient->sessionId = $_SESSION['sessionId'];

First, the site hosting your external link should be supporting https.

Second, download the partner wsdl file and place it on your web site.

Next, the link for your web tab needs to include the sessionId and location. It will look something like this:


The above example is for php.

On the web page, you need to re-establish the session using the sessionId and location. The specifics for this depend on the language.

The code above uses the sforce php tool kit and php 5.1.4.



Hi Sanjay, Browsing thorough the community, found this post which is relavant to my question. I am also having same requirement....where in user logs into salesforce, and when he clicks on some tab he needs to login to another application automatically either using same salesforce credentials or by fetching username & password from a custom object in salesforce. Can you please let me know how to implement this and what we need from salesforce end and the other application end. Also there is another requirement where in we need to maintain the session for the other web application as long as salesforce session is active. Any inputs are appreciated. Thanks