I am trying to create a web page using javscript that uses form based authentication to login to the sharepoint server but it keeps using NTLM which is windows based authentication. Is there anyway to allow form based authentication using javascript as this web page is for mobile and phonegap? Thanks in advance. Any help appreciated.
My code is as follows:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<script src="jquery-1.6.2.min.js" type="text/javascript"></script>
</head>
<body>
<div>
<script type="text/javascript">
$(document).ready(function () {
var soapEnv = "<soap:Envelope xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'> \
<soap:Body> \
<Login xmlns='http://schemas.microsoft.com/sharepoint/soap/'> \
<username>username1</username> \
<password>password</password> \
</Login> \
</soap:Body> \
</soap:Envelope>"
// Call web service
$.ajax({
url: "http://servername:serverport/_vti_bin/authentication.asmx",
type: "POST",
dataType: "xml",
data: soapEnv,
complete: processListAccessResult,
contentType: "text/xml; charset=\"utf-8\""
});
});
// Process result
function processListAccessResult(xData, status) {
alert(xData);
alert(status);
}
</script>
<ul id="data"></ul>
</div>
</body>
</html>