Simple module to provide NTLM authentication on Android using JCIFS. Requires Titanium SDK version 3.0 GA or above. Uses JCIFS Version 1.3.17 See example for usage.
To access this module from JavaScript, you would do the following:
var jcifsntlm = require("com.jcifsntlm");
The jcifsntlm variable is a reference to the Module object.
returns "ntlm"
returns Object
var url = "http://someserver";
var client = Ti.Network.createHTTPClient({
// function called when the response data is available
onload : function(e) {
Ti.API.info("Received text: " + this.responseText);
},
// function called when an error occurs, including a timeout
onerror : function(e) {
Ti.API.info(e.error);
},
timeout : 5000 // in milliseconds
});
client.username = 'someusername';
client.password = 'somepassword';
client.domain = 'someDomain';
//ANDROID SPECIFIC CODE STARTS.
var jcifsntlm = require("com.jcifsntlm");
client.addAuthFactory(jcifsntlm.getAuthScheme(),jcifsntlm.getAuthFactory());
//ANDROID SPECIFIC CODE ENDS.
// Prepare the connection.
client.open("GET", url);
// Send the request.
client.send();
Vishal Duggal vduggal@appcelerator.com
GNU LGPL 2.1 http://www.gnu.org/licenses/lgpl-2.1.txt