{"name":"webauth","description":"Web authentication module","version":"0.1.4","author":{"name":"Sam Decrock","url":"https://github.com/SamDecrock/"},"contributors":[{"name":"Churkin Andrey","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.4","_shasum":"9475ffe15b37a227c925a62366218e8aba68e755","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.6.0","_npmUser":{"name":"churkin","email":"alam17@mail.ru"},"dist":{"shasum":"9475ffe15b37a227c925a62366218e8aba68e755","tarball":"http://registry-npm.ywwl.com/webauth/download/webauth-0.1.4.tgz","integrity":"sha512-zqAi1//viN8RmtqA5lncYO7kwKnFjhzJK1ovGROH7rit/JK0Qiqnni1AVwUkIKqYdRKyJ2bVN9NGTcpoqc3lmA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAcuU0GC38riFDXPGV+fjqQkicSnDsGWMQYqdQq7ohMXAiBWkNvI9exo2CyW0VUmCpRcrAuQDJQuCSvfONcvaV8KUQ=="}],"size":6274,"noattachment":false,"key":"/webauth/-/webauth-0.1.4.tgz"},"maintainers":[{"name":"churkin","email":"alam17@mail.ru"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/webauth-0.1.4.tgz_1477385594099_0.020227425266057253"},"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":1477385596285,"_cnpm_publish_time":1477385596285,"dist-tags":{"latest":"1.1.0"}}