{"name":"webauth","description":"Web authentication module","version":"0.1.3","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.3","_shasum":"c3c9812a83c74ba89b439ba4f4ade190a9f8d595","_from":".","_npmVersion":"2.14.4","_nodeVersion":"4.1.1","_npmUser":{"name":"churkin","email":"alam17@mail.ru"},"dist":{"shasum":"c3c9812a83c74ba89b439ba4f4ade190a9f8d595","tarball":"http://registry-npm.ywwl.com/webauth/download/webauth-0.1.3.tgz","integrity":"sha512-ozXQx//foqtDwv62J13dCuHa8oMXh0EYo/JFjodrJs/ZZ/GpZKUoEWjub4dlkgfVX/FZQcgyrA9jYkiHIqEG1Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDZMjqlNVvlt5z4K47/1Uq6sFUSyz92iIVmMk9yrdLrQAIgPLXWT5qhToPEp/OI+LGyNrLvLDM5tu2Q5jR4uHrv2l0="}],"size":6293,"noattachment":false,"key":"/webauth/-/webauth-0.1.3.tgz"},"maintainers":[{"name":"churkin","email":"alam17@mail.ru"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/webauth-0.1.3.tgz_1467028424575_0.2754497507121414"},"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":1467028427134,"_cnpm_publish_time":1467028427134,"dist-tags":{"latest":"1.1.0"}}