You need to sign in to do that
Don't have an account?
Use Jquery to login to salesforce
Hi Guys,
I have this dilemma here for days, I can't manage to login to salesforce using Jquery.What I needed is after I login, I will parse the response and get the sessionId. This error occurs after I try to login:
XMLHttpRequest cannot load https://login.salesforce.com/services/oauth2/token. Origin https://c.ap1.visual.force.com is not allowed by Access-Control-Allow-Origin.
These my code:
$j.ajax({
type: 'POST',
url: 'https://login.salesforce.com/services/oauth2/token',
data: 'grant_type=password&client_id='+ clientId + '&client_secret=' +secretKey + '&username=' +username +'&password=' + password,
success: function(data){
response = data;
}});
Your help would much be appreciated.
Cheers,
I'm having the exact same issue. :-(