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
shankstarrshankstarr 

Authenticating a Salesforce Self-Service Support User to an external site

Hello,

My organization has a support portal with its own authentication (PHP5, mysql) outside of salesforce-- however, we would like to have  our users login with their Salesforce self-service support credentials to gain access to our site. How do I build a mechanism to authenticate users against their salesforce self-service accounts, and then upon success-- allow them access to our site? Thanks in advance!

Leon Yen
Inxight Software, Inc.
Tran ManTran Man
Have you checked out the self service portal toolkit
shankstarrshankstarr
Hi Nick,

Thanks for responding.... I have-- the Users.xml file is throwing me off. I'm not sure how it's to be used-- how does the file get populated, and how does it tie back to the salesforce accounts? Also, we're on PHP 5.1.4, but may need to maintain backwards compatibility, which was causing the XML piece to err out. How would I get the scripts to work without the XML piece(s), if possible at all?

Thanks in advance!

Cheers,
Leon
Tran ManTran Man
Users.xml is included purely for the sample and merely represents the authentication happens on an external system--think placeholder.  I don't expect anyone to use it in production at all. 

What kind of error are you getting?
shankstarrshankstarr

We were getting an PHP XML error. I had our sysadmin turn off Backward Compatibility mode in the php.ini file, so it does not err out anymore.

However, I am having difficulty in general with the toolkit. This is totally due to my inexperience, however.

Basically, I need to know how to send a query to salesforce originating from our own support portal with the user's SF self-service username and password, capture a success or fail, and route them accordingly. What are the specific areas/libraries/code snippets I should be looking at to do this?

Thanks!!!

-Leon 

SuperfellSuperfell
There's no API available today to do self service user authentication, you have to "scrape" the HTML self service login page. A real api for authenticating self service users is on the api roadmap.
chuckdubdubchuckdubdub
So is that to say it isn't possible to integrate the self-service portal with a local web site? 

We're currently "registering" customers via an open source CMS login system, and we'd like to essentially have their logins and access to support materials managed via "validated" SF self-service credentials, presumably using the API.  So it appears that in order to do this we'd have to make a series of background HTTP calls to the Salesforce login routines?

-Chuck
Tran ManTran Man
It is not possible via the API, but it is possible via HTML screen scraping like Simon says.

THis is exactly what the Self-Service Portal Toolkit does: 
Tran ManTran Man
If you can't get the XML part to work, just fake the authentication in the XMLSecurityHandler class. 

Instead of this,

Code:
  static function authenticate($username, $password) {
    $users = simplexml_load_file('Users.xml');
    foreach ($users as $user) {
      if ($user->UserName == $username && $user->UserPassword == sha1($password)) {
        return $user;
      }
    }
    return null;
  }
try doing this

Code:
  static function authenticate($username, $password) {
    $user->UserName = "fred";
    $user->UserPassword = "password";
    return $user;
  }



 

Message Edited by Tran Man on 08-05-2006 10:05 AM