pekim/tedious — pull request #164 by arobson (2014-07-11 11:54:48+00:00)
Title: Adding support for NTLM

To activate NTLM auth, simply include a domain property in the configuration hash.

```coffeescript
tedious = require( './src/tedious.coffee' )
Request = t.Request
config = userName: '{username}',
password: '{password}',
domain: '{domain}',
server: '{host}',
options:
database: '{databasename}'

callback = ( err, rows ) ->
if err
console.log( err )
else
console.log( 'rows retrieved', rows )

request = new Request( 'select top 10 * from {tablename}', callback )
connection = new tedious.Connection( config )

connection.on( 'connect', ( err ) ->
unless err
c.execSql( r )
)

request.on( 'row', ( columns ) ->
console.log( 'row' )
)
```

This PR was based on documentation from:
* [NTLM Protocol](http://davenport.sourceforge.net/ntlm.html)

and source code from the following repositories:
* [jTDS](http://sourceforge.net/projects/jtds/files/jtds/)
* [tedious-ntlm](https://github.com/wedjaaopen/tedious)
* [ntlmauth](https://github.com/wedjaaopen/ntlmauth)

Huge thanks to the folks who blazed the trail beforehand. I tried to adhere to the style of the lib. Please let me know what I can do to improve this PR if need be to get it included.

My primary motivation for wanting this addition is that we'd like the ability to establish connections to our SQL server via NTLM from any OS without the usual prerequisite Windows-only libraries. Hopefully this is a value add for others using Tedious as well.

Thanks for this great library!