0

I wanna login salesforce from my website. So how to make it without going to the salesforce login page. Authentication should be done in background.

1

Using SOAP API You can login.

Create a text file called login.txt containing the following text:

<?xml version="1.0" encoding="utf-8" ?>
<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
  <env:Body>
    <n1:login xmlns:n1="urn:partner.soap.sforce.com">
      <n1:username>your_username</n1:username>
      <n1:password>your_password</n1:password>
    </n1:login>
  </env:Body>
</env:Envelope>

Replace your_username and your_password with your Salesforce user name and password. Using a command-line window, execute the following cURL command: curl https://login.salesforce.com/services/Soap/u/33.0 -H "Content-Type: text/xml; charset=UTF-8" -H "SOAPAction: login" -d @login.txt

The Soap/u/ portion of the URI specifies the partner WSDL. You can use Soap/c/ to specify the enterprise WSDL. Salesforce returns an XML response that includes and elements. Note the values of the element and the first part of the host name (instance), such as na1-api, from the element. Use these values in subsequent requests to the Bulk API.

  • 1
    Should we give our username and password in that text file. I wanna integrate dynamically. is this possible? Juts think i have the login page in website. anyone can login the slaesofrce account form my website. this is what am expect. – SFDC Fresher Apr 24 '15 at 6:45
-1

You can use Salesforce API for that.

  • 1
    That's a very short answer, any elaborations you could add ? – Samuel De Rycke Apr 23 '15 at 13:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.