{"name":"webauth","description":"Web authentication module","version":"0.1.2","author":{"name":"Sam Decrock","url":"https://github.com/SamDecrock/"},"contributors":[{"name":"Churkin Andrey","email":"a.sturmfuhrer@gmail.com","url":"https://github.com/churkin"}],"engines":{"node":">= 0.10.0"},"repository":{"type":"git","url":"git+https://github.com/churkin/webauth.git"},"main":"./webauth","licenses":[{"type":"MIT","url":"http://www.opensource.org/licenses/mit-license.php"}],"gitHead":"66d6a178691a65dc5dcd6d2b7b9b71cb82f50a3a","bugs":{"url":"https://github.com/churkin/webauth/issues"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"keywords":["npm","module"],"license":"MIT","homepage":"https://github.com/churkin/webauth#readme","_id":"webauth@0.1.2","_shasum":"dbe78b81ff56a9d1a060711a99dc620123e8c7bc","_from":".","_npmVersion":"2.14.4","_nodeVersion":"4.1.1","_npmUser":{"name":"churkin","email":"alam17@mail.ru"},"dist":{"shasum":"dbe78b81ff56a9d1a060711a99dc620123e8c7bc","tarball":"http://registry-npm.ywwl.com/webauth/download/webauth-0.1.2.tgz","integrity":"sha512-QaF/ZNV/winGKSQdmYvYt5LldLO+42bdsskHu815YqdDQWrq8IVf7jw4iSLx1N/0BFlXdg/w98hZM3/6AyhGTg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDkc8o5IjIy9sqyBNbBu9E6mueyG1nCPB9/6u6OBq170wIgPhPdpG8MlFaBEIe6/8Kpq/gWP+GOs5r7VttuiGEbvBc="}],"size":6187,"noattachment":false,"key":"/webauth/-/webauth-0.1.2.tgz"},"maintainers":[{"name":"churkin","email":"alam17@mail.ru"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/webauth-0.1.2.tgz_1467027060743_0.6983378147706389"},"readme":"# webauth\r\n\r\nThe Node.js module implements the main mechanisms of web authentication.\r\nAt the moment webauth supports the following types of authentication:\r\n  * NTLM (The implementation of this type uses code written by [SamDecrock](https://github.com/SamDecrock) ([node-http-ntlm](https://github.com/SamDecrock/node-http-ntlm))\r\n  * Basic\r\n\r\n## How to install\r\n\r\nThis project is a Node.js module that you can add to your application via the `npm` packet manager:\r\n\r\n  `npm install webauth`\r\n\r\n## How to use\r\n\r\nTo authenticate the request to the server, use the `auth` method:\r\n\r\n`auth(reqOptions, credentials, callback, [isHttps=false], [res], [method])`\r\n\r\n  * `reqOptions` - The request options object uses a signature identical to the [Node.js http/https request options](http://nodejs.org/api/http.html#http_http_request_options_callback);\r\n  * `credentials` - The object to which authentication parameters are passed:\r\n\r\n  ````\r\n  {\r\n      username : 'Churkin.Andrey',  // required field \r\n      password : 'myPass$1',        // required field\r\n      domain : 'CORP',              // is used in the NTLM auth\r\n      workstation: 'CHURKIN-LINUX'  // is used in the NTLM auth\r\n  }\r\n  ````\r\n\r\n  * `callback` - The function that will be called after the authentication;\r\n  * `isHttps` - Set `true` to use https protocol (`false` by default);\r\n  * `res` - An optional parameter that you need to pass to the method if you have already received a response from the server with the 401 error;\r\n  * `method` - The authentication type to be used. Possible values are: `NTLM`, `Basic`. If this value is not specified, it will be automatically selected based on the following priorities:\r\n      * NTLM\r\n      * Basic\r\n\r\n## Example\r\n\r\n````\r\nvar webauth = require('webauth');\r\n\r\nvar reqOptions = {\r\n\t\thost: 'localhost',\r\n\t\theaders: {\r\n\t\t\t'accept-encoding' : 'gzip,deflate,sdch'\r\n\t\t}\r\n\t},\r\n\tcredentials = {\r\n\t\tusername: 'Churkin.Andrey',\r\n\t\tpassword: 'myPass$1',\r\n\t\tdomain: 'CORP',\r\n\t\tworkstation: 'CHURKIN-LINUX'\r\n\t};\r\n\r\nwebauth.auth(reqOptions, credentials, function(res) {\r\n\tconsole.log(res.statusCode);\r\n});\r\n````\r\n\r\n","publish_time":1467027063134,"_cnpm_publish_time":1467027063134,"dist-tags":{"latest":"1.1.0"}}