I am trying to authenticate to a Google account using Google’s ClientLogin method. I am trying to do this via jQuery; however, with my current code, I am getting a 405 Method Not Allowed response from Google.
Below is a sample of my code:
$(document).ready(function() {
$('#connect').click(function(){
$.ajax({
type: "POST",
contentType: "application/x-www-form-urlencoded",
url: "https://www.google.com/accounts/ClientLogin",
data: ({accountType:"HOSTED_OR_GOOGLE", Email:"user@gmail.com", Passwd:"UserPass", service:"cl", source:"User-APP-01"})
});
});
});
Thank you in advance for your assistance. Any help would be greatly appreciated.
You cant use ajax to request domain other than you running on.
U have to send data to your server, and check authorisation by ie php or something, and then return result to jquery.