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
Ranu JainRanu Jain 

salesforce login from html page

i have to login into salesforce  org by an html page outside the salesforce....please giv some suggestion what to do for it ...n  i have to include below file

<script src="/soap/ajax/11.0/connection.js"></script>
<script src="/soap/ajax/11.0/apex.js"></script>

 should i have to download it ...? from where


Hi Ranu,


If you want to connect to from a standalone application , one way would be consuming partner/enterprise wsdl ,call the login method with your username as your username and password as your instance password+security token.


If you simply want to login to from a html page try to use something like this

<a href="">Login to My developer account</a>

 username - username, password - password.

if you are trying to login to a sandbox then please use something like this 


<a href="">Login to My Sandbox account</a>




Hope this helps,


(please don't forget to mark this post as the solution if it is the solution)


You have to include the absolute URL of the file, or browser security will probably stop you from running the login script. Then again, your browser might prohibit you anyways, and you'd need to use a JSONP or AJAX proxy. Be wary of using leaving an open proxy on your server, though...

Ranu JainRanu Jain

Thnaks for atual need is not login...but i have to fetch some data from the org like  all account  ........and display taht data in html page ....for which i was thinking that i have to write code to connect to salesforce and login ....does is possible by ur first rply ...or any other approach?


Actually Above code is looging in the account ,

But How to show Errors like password is not correct or username not valid etc which is generated by salsforce  in my custom page. 

Hi Ranu,

         As I doing the same task that, how to login throught html page and getting details from salesforce i heard that to use API. But i can't getting the salesforce API. and i done this task but... instead of getting the details i going that details at time with login.

If this solves your problem, kindly mark it as the best answer.