authorify
Version:
Authorization and authentication system for REST server
1 lines • 34.8 kB
JavaScript
Ext.data.JsonP.node_modules_authorify({"mixedInto":[],"subclasses":[],"requires":[],"parentMixins":[],"author":[{"tagname":"author","name":"Marcello Gesmundo","email":null}],"autodetected":{},"uses":["node_modules.authorify.authentication","node_modules.authorify.authorization"],"superclasses":[],"alternateClassNames":[],"mixins":[],"members":[{"owner":"node_modules.authorify","tagname":"cfg","meta":{},"name":"SECRET","id":"cfg-SECRET"},{"owner":"node_modules.authorify","tagname":"cfg","meta":{},"name":"SECRET_CLIENT","id":"cfg-SECRET_CLIENT"},{"owner":"node_modules.authorify","tagname":"cfg","meta":{},"name":"SECRET_SERVER","id":"cfg-SECRET_SERVER"},{"owner":"node_modules.authorify","tagname":"cfg","meta":{},"name":"authHeader","id":"cfg-authHeader"},{"owner":"node_modules.authorify","tagname":"cfg","meta":{},"name":"authPath","id":"cfg-authPath"},{"owner":"node_modules.authorify","tagname":"cfg","meta":{},"name":"ca","id":"cfg-ca"},{"owner":"node_modules.authorify","tagname":"cfg","meta":{},"name":"cert","id":"cfg-cert"},{"owner":"node_modules.authorify","tagname":"cfg","meta":{},"name":"clockSkew","id":"cfg-clockSkew"},{"owner":"node_modules.authorify","tagname":"cfg","meta":{},"name":"connection","id":"cfg-connection"},{"owner":"node_modules.authorify","tagname":"cfg","meta":{},"name":"crypto","id":"cfg-crypto"},{"owner":"node_modules.authorify","tagname":"cfg","meta":{},"name":"debug","id":"cfg-debug"},{"owner":"node_modules.authorify","tagname":"cfg","meta":{},"name":"encryptQuery","id":"cfg-encryptQuery"},{"owner":"node_modules.authorify","tagname":"cfg","meta":{},"name":"encryptedBodyName","id":"cfg-encryptedBodyName"},{"owner":"node_modules.authorify","tagname":"cfg","meta":{},"name":"encryptedSignatureName","id":"cfg-encryptedSignatureName"},{"owner":"node_modules.authorify","tagname":"cfg","meta":{},"name":"freeRoutes","id":"cfg-freeRoutes"},{"owner":"node_modules.authorify","tagname":"cfg","meta":{},"name":"handshakePath","id":"cfg-handshakePath"},{"owner":"node_modules.authorify","tagname":"cfg","meta":{},"name":"key","id":"cfg-key"},{"owner":"node_modules.authorify","tagname":"cfg","meta":{},"name":"logger","id":"cfg-logger"},{"owner":"node_modules.authorify","tagname":"cfg","meta":{},"name":"login","id":"cfg-login"},{"owner":"node_modules.authorify","tagname":"cfg","meta":{},"name":"logoutPath","id":"cfg-logoutPath"},{"owner":"node_modules.authorify","tagname":"cfg","meta":{},"name":"persist","id":"cfg-persist"},{"owner":"node_modules.authorify","tagname":"cfg","meta":{},"name":"sessionStore","id":"cfg-sessionStore"},{"owner":"node_modules.authorify","tagname":"cfg","meta":{},"name":"sidLength","id":"cfg-sidLength"},{"owner":"node_modules.authorify","tagname":"cfg","meta":{},"name":"sidTtl","id":"cfg-sidTtl"},{"owner":"node_modules.authorify","tagname":"cfg","meta":{},"name":"signBody","id":"cfg-signBody"},{"owner":"node_modules.authorify","tagname":"cfg","meta":{},"name":"tokenTtl","id":"cfg-tokenTtl"},{"owner":"node_modules.authorify","tagname":"cfg","meta":{},"name":"userIdFieldName","id":"cfg-userIdFieldName"},{"owner":"node_modules.authorify","tagname":"property","meta":{},"name":"authentication","id":"property-authentication"},{"owner":"node_modules.authorify","tagname":"property","meta":{},"name":"authorization","id":"property-authorization"},{"owner":"node_modules.authorify","tagname":"method","meta":{},"name":"load","id":"method-load"}],"tagname":"class","short_doc":"This is an authentication and authorization middleware for a REST server with data encryption and signing. ...","meta":{},"name":"node_modules.authorify","component":false,"id":"class-node_modules.authorify","html":"<div><pre class=\"hierarchy\"><h4>Uses</h4><div class='dependency'><a href='#!/api/node_modules.authorify.authentication' rel='node_modules.authorify.authentication' class='docClass'>node_modules.authorify.authentication</a></div><div class='dependency'><a href='#!/api/node_modules.authorify.authorization' rel='node_modules.authorify.authorization' class='docClass'>node_modules.authorify.authorization</a></div><h4>Files</h4><div class='dependency'><a href='source/default.html#node_modules-authorify' target='_blank'>default.js</a></div></pre><div class='doc-contents'><p>This is an authentication and authorization middleware for a REST server with data encryption and signing.\nYou can use it with <a href=\"http://mcavage.me/node-restify\">restify</a> or other server compatible with a generic middleware: <code>function (req, res, next) {...}</code>.\nSee more details in README file.</p>\n\n<h1>License</h1>\n\n<p>Copyright (c) 2012-2014 Yoovant by Marcello Gesmundo. All rights reserved.</p>\n\n<p>This program is released under a GNU Affero General Public License version 3 or above, which in summary means:</p>\n\n<ul>\n<li>You <strong>can use</strong> this program for <strong>no cost</strong>.</li>\n<li>You <strong>can use</strong> this program for <strong>both personal and commercial reasons</strong>.</li>\n<li>You <strong>do not have to share your own program's code</strong> which uses this program.</li>\n<li>You <strong>have to share modifications</strong> (e.g bug-fixes) you've made to this program.</li>\n<li>For more convoluted language, see the LICENSE file.</li>\n</ul>\n\n</div><div class='members'><div class='members-section'><div class='definedBy'>Defined By</div><h3 class='members-title icon-cfg'>Config options</h3><div class='subsection'><div id='cfg-SECRET' class='member first-child not-inherited'><a href='#' class='side expandable'><span> </span></a><div class='title'><div class='meta'><span class='defined-in' rel='node_modules.authorify'>node_modules.authorify</span><br/><a href='source/default.html#node_modules-authorify-cfg-SECRET' target='_blank' class='view-source'>view source</a></div><a href='#!/api/node_modules.authorify-cfg-SECRET' class='name expandable'>SECRET</a> : String<span class=\"signature\"></span></div><div class='description'><div class='short'>The secret key used in hash operations ...</div><div class='long'><p>The secret key used in hash operations</p>\n<p>Defaults to: <code>'secret'</code></p></div></div></div><div id='cfg-SECRET_CLIENT' class='member not-inherited'><a href='#' class='side expandable'><span> </span></a><div class='title'><div class='meta'><span class='defined-in' rel='node_modules.authorify'>node_modules.authorify</span><br/><a href='source/default.html#node_modules-authorify-cfg-SECRET_CLIENT' target='_blank' class='view-source'>view source</a></div><a href='#!/api/node_modules.authorify-cfg-SECRET_CLIENT' class='name expandable'>SECRET_CLIENT</a> : String<span class=\"signature\"></span></div><div class='description'><div class='short'>The key used in conjunction with SECRET to verify handshake token. ...</div><div class='long'><p>The key used in conjunction with SECRET to verify handshake token. This key must be the same on both the server and the client.</p>\n<p>Defaults to: <code>'secret_client'</code></p></div></div></div><div id='cfg-SECRET_SERVER' class='member not-inherited'><a href='#' class='side expandable'><span> </span></a><div class='title'><div class='meta'><span class='defined-in' rel='node_modules.authorify'>node_modules.authorify</span><br/><a href='source/default.html#node_modules-authorify-cfg-SECRET_SERVER' target='_blank' class='view-source'>view source</a></div><a href='#!/api/node_modules.authorify-cfg-SECRET_SERVER' class='name expandable'>SECRET_SERVER</a> : String<span class=\"signature\"></span></div><div class='description'><div class='short'>The key used in conjunction with SECRET to create authorization token ...</div><div class='long'><p>The key used in conjunction with SECRET to create authorization token</p>\n<p>Defaults to: <code>'secret_server'</code></p></div></div></div><div id='cfg-authHeader' class='member not-inherited'><a href='#' class='side expandable'><span> </span></a><div class='title'><div class='meta'><span class='defined-in' rel='node_modules.authorify'>node_modules.authorify</span><br/><a href='source/default.html#node_modules-authorify-cfg-authHeader' target='_blank' class='view-source'>view source</a></div><a href='#!/api/node_modules.authorify-cfg-authHeader' class='name expandable'>authHeader</a> : String<span class=\"signature\"></span></div><div class='description'><div class='short'>The header used for authentication and authorization ...</div><div class='long'><p>The header used for authentication and authorization</p>\n<p>Defaults to: <code>'Authorization'</code></p></div></div></div><div id='cfg-authPath' class='member not-inherited'><a href='#' class='side expandable'><span> </span></a><div class='title'><div class='meta'><span class='defined-in' rel='node_modules.authorify'>node_modules.authorify</span><br/><a href='source/default.html#node_modules-authorify-cfg-authPath' target='_blank' class='view-source'>view source</a></div><a href='#!/api/node_modules.authorify-cfg-authPath' class='name expandable'>authPath</a> : String<span class=\"signature\"></span></div><div class='description'><div class='short'>The route exposed by the server for the authentication/authorization phases ...</div><div class='long'><p>The route exposed by the server for the authentication/authorization phases</p>\n<p>Defaults to: <code>'/auth'</code></p></div></div></div><div id='cfg-ca' class='member not-inherited'><a href='#' class='side expandable'><span> </span></a><div class='title'><div class='meta'><span class='defined-in' rel='node_modules.authorify'>node_modules.authorify</span><br/><a href='source/default.html#node_modules-authorify-cfg-ca' target='_blank' class='view-source'>view source</a></div><a href='#!/api/node_modules.authorify-cfg-ca' class='name expandable'>ca</a> : String<span class=\"signature\"></span></div><div class='description'><div class='short'><p>The Certification Authority certificate in pem format</p>\n</div><div class='long'><p>The Certification Authority certificate in pem format</p>\n</div></div></div><div id='cfg-cert' class='member not-inherited'><a href='#' class='side expandable'><span> </span></a><div class='title'><div class='meta'><span class='defined-in' rel='node_modules.authorify'>node_modules.authorify</span><br/><a href='source/default.html#node_modules-authorify-cfg-cert' target='_blank' class='view-source'>view source</a></div><a href='#!/api/node_modules.authorify-cfg-cert' class='name expandable'>cert</a> : String<span class=\"signature\"></span></div><div class='description'><div class='short'><p>The server X.509 certificate in pem format</p>\n</div><div class='long'><p>The server X.509 certificate in pem format</p>\n</div></div></div><div id='cfg-clockSkew' class='member not-inherited'><a href='#' class='side expandable'><span> </span></a><div class='title'><div class='meta'><span class='defined-in' rel='node_modules.authorify'>node_modules.authorify</span><br/><a href='source/default.html#node_modules-authorify-cfg-clockSkew' target='_blank' class='view-source'>view source</a></div><a href='#!/api/node_modules.authorify-cfg-clockSkew' class='name expandable'>clockSkew</a> : Integer<span class=\"signature\"></span></div><div class='description'><div class='short'>Max age (in seconds) of the request/reply. ...</div><div class='long'><p>Max age (in seconds) of the request/reply.\nEvery request must have a valid response within clockSkew seconds.\nNote: you must enable a NTP server both on client and server. Set 0 to disable date check or 300 like Kerberos.</p>\n<p>Defaults to: <code>0</code></p></div></div></div><div id='cfg-connection' class='member not-inherited'><a href='#' class='side expandable'><span> </span></a><div class='title'><div class='meta'><span class='defined-in' rel='node_modules.authorify'>node_modules.authorify</span><br/><a href='source/default.html#node_modules-authorify-cfg-connection' target='_blank' class='view-source'>view source</a></div><a href='#!/api/node_modules.authorify-cfg-connection' class='name expandable'>connection</a> : connection<span class=\"signature\"></span></div><div class='description'><div class='short'>REDIS connection information ...</div><div class='long'><p>REDIS connection information</p>\n<ul><li><span class='pre'>port</span> : Number<div class='sub-desc'><p>REDIS port</p>\n<p>Defaults to: <code>6379</code></p></div></li><li><span class='pre'>host</span> : String<div class='sub-desc'><p>REDIS host</p>\n<p>Defaults to: <code>'127.0.0.1'</code></p></div></li><li><span class='pre'>db</span> : String (optional)<div class='sub-desc'><p>REDIS database for sessions</p>\n</div></li><li><span class='pre'>user</span> : String (optional)<div class='sub-desc'><p>REDIS user</p>\n</div></li><li><span class='pre'>pass</span> : String (optional)<div class='sub-desc'><p>REDIS password</p>\n</div></li></ul></div></div></div><div id='cfg-crypto' class='member not-inherited'><a href='#' class='side expandable'><span> </span></a><div class='title'><div class='meta'><span class='defined-in' rel='node_modules.authorify'>node_modules.authorify</span><br/><a href='source/default.html#node_modules-authorify-cfg-crypto' target='_blank' class='view-source'>view source</a></div><a href='#!/api/node_modules.authorify-cfg-crypto' class='name expandable'>crypto</a> : Object<span class=\"signature\"></span></div><div class='description'><div class='short'>Cryptographic engine ...</div><div class='long'><p>Cryptographic engine</p>\n<p>Defaults to: <code>node-forge</code></p></div></div></div><div id='cfg-debug' class='member not-inherited'><a href='#' class='side expandable'><span> </span></a><div class='title'><div class='meta'><span class='defined-in' rel='node_modules.authorify'>node_modules.authorify</span><br/><a href='source/default.html#node_modules-authorify-cfg-debug' target='_blank' class='view-source'>view source</a></div><a href='#!/api/node_modules.authorify-cfg-debug' class='name expandable'>debug</a> : Boolean<span class=\"signature\"></span></div><div class='description'><div class='short'>true to enable verbose log ...</div><div class='long'><p>true to enable verbose log</p>\n<p>Defaults to: <code>true</code></p></div></div></div><div id='cfg-encryptQuery' class='member not-inherited'><a href='#' class='side expandable'><span> </span></a><div class='title'><div class='meta'><span class='defined-in' rel='node_modules.authorify'>node_modules.authorify</span><br/><a href='source/default.html#node_modules-authorify-cfg-encryptQuery' target='_blank' class='view-source'>view source</a></div><a href='#!/api/node_modules.authorify-cfg-encryptQuery' class='name expandable'>encryptQuery</a> : Boolean<span class=\"signature\"></span></div><div class='description'><div class='short'>Encrypt the values in url query string ...</div><div class='long'><p>Encrypt the values in url query string</p>\n<p>Defaults to: <code>true</code></p></div></div></div><div id='cfg-encryptedBodyName' class='member not-inherited'><a href='#' class='side expandable'><span> </span></a><div class='title'><div class='meta'><span class='defined-in' rel='node_modules.authorify'>node_modules.authorify</span><br/><a href='source/default.html#node_modules-authorify-cfg-encryptedBodyName' target='_blank' class='view-source'>view source</a></div><a href='#!/api/node_modules.authorify-cfg-encryptedBodyName' class='name expandable'>encryptedBodyName</a> : String<span class=\"signature\"></span></div><div class='description'><div class='short'>The property name for the encrypted body value ...</div><div class='long'><p>The property name for the encrypted body value</p>\n<p>Defaults to: <code>'ncryptdbdnm'</code></p></div></div></div><div id='cfg-encryptedSignatureName' class='member not-inherited'><a href='#' class='side expandable'><span> </span></a><div class='title'><div class='meta'><span class='defined-in' rel='node_modules.authorify'>node_modules.authorify</span><br/><a href='source/default.html#node_modules-authorify-cfg-encryptedSignatureName' target='_blank' class='view-source'>view source</a></div><a href='#!/api/node_modules.authorify-cfg-encryptedSignatureName' class='name expandable'>encryptedSignatureName</a> : String<span class=\"signature\"></span></div><div class='description'><div class='short'>The property name for the signature value of the body ...</div><div class='long'><p>The property name for the signature value of the body</p>\n<p>Defaults to: <code>'ncryptdsgnnm'</code></p></div></div></div><div id='cfg-freeRoutes' class='member not-inherited'><a href='#' class='side expandable'><span> </span></a><div class='title'><div class='meta'><span class='defined-in' rel='node_modules.authorify'>node_modules.authorify</span><br/><a href='source/default.html#node_modules-authorify-cfg-freeRoutes' target='_blank' class='view-source'>view source</a></div><a href='#!/api/node_modules.authorify-cfg-freeRoutes' class='name expandable'>freeRoutes</a> : Boolean<span class=\"signature\"></span></div><div class='description'><div class='short'>Enable routes without Authorization header. ...</div><div class='long'><p>Enable routes without Authorization header. When false the authorization header is mandatory for every route even if the route does not have a specific authorization. Set true to try to manage a route if it does not have an authorization handler.</p>\n\n<h2>Example 1</h2>\n\n<pre><code> // dependencies\n var restify = require('restify'),\n authorify = require('auhtorify')({\n freeRoutes: true\n // other options\n });\n\n // create the server\n var server = restify.createServer();\n\n // add middlewares\n server.use(restify.queryParser({ mapParams: false }));\n server.use(restify.bodyParser());\n server.use(authorify.authentication);\n\n // last route handler\n var ok = function(req, res, next){\n res.send({ success: true });\n };\n\n // routes\n // in the route below 'ok' can handled if the request is with or without the Authorization header\n server.get('/free', ok);\n // in the route below if the request doesn't have the Authorization header, the sec.isLoggedIn()\n // handler is performed, but fails and the 'ok' handler isn't reached\n server.get('/secure', sec.isLoggedIn(), ok);\n</code></pre>\n\n<h2>Example 2</h2>\n\n<pre><code> // dependencies\n var restify = require('restify'),\n authorify = require('auhtorify')({\n freeRoutes: false\n // other options\n });\n\n // create the server\n var server = restify.createServer();\n\n // add middlewares\n server.use(restify.queryParser({ mapParams: false }));\n server.use(restify.bodyParser());\n server.use(authorify.authentication);\n\n // last route handler\n var ok = function(req, res, next){\n res.send({ success: true });\n };\n\n // routes\n // in the route below 'ok' can handled only if the request has the Authorization header\n server.get('/free', ok);\n // in then route below if the request doesn't have the Authorization header, the sec.isLoggedIn() handler\n // isn't reached and the request fails; if the request have the Authorization header but the user\n // isn't logged, the 'ok' handler ins't performed (e.g.: session expired)\n server.get('/secure', sec.isLoggedIn(), ok);\n</code></pre>\n<p>Defaults to: <code>true</code></p></div></div></div><div id='cfg-handshakePath' class='member not-inherited'><a href='#' class='side expandable'><span> </span></a><div class='title'><div class='meta'><span class='defined-in' rel='node_modules.authorify'>node_modules.authorify</span><br/><a href='source/default.html#node_modules-authorify-cfg-handshakePath' target='_blank' class='view-source'>view source</a></div><a href='#!/api/node_modules.authorify-cfg-handshakePath' class='name expandable'>handshakePath</a> : String<span class=\"signature\"></span></div><div class='description'><div class='short'>The route exposed by the server for the handshake phase ...</div><div class='long'><p>The route exposed by the server for the handshake phase</p>\n<p>Defaults to: <code>'/handshake'</code></p></div></div></div><div id='cfg-key' class='member not-inherited'><a href='#' class='side expandable'><span> </span></a><div class='title'><div class='meta'><span class='defined-in' rel='node_modules.authorify'>node_modules.authorify</span><br/><a href='source/default.html#node_modules-authorify-cfg-key' target='_blank' class='view-source'>view source</a></div><a href='#!/api/node_modules.authorify-cfg-key' class='name expandable'>key</a> : String<span class=\"signature\"></span></div><div class='description'><div class='short'><p>The server private RSA key in pem format</p>\n</div><div class='long'><p>The server private RSA key in pem format</p>\n</div></div></div><div id='cfg-logger' class='member not-inherited'><a href='#' class='side expandable'><span> </span></a><div class='title'><div class='meta'><span class='defined-in' rel='node_modules.authorify'>node_modules.authorify</span><br/><a href='source/default.html#node_modules-authorify-cfg-logger' target='_blank' class='view-source'>view source</a></div><a href='#!/api/node_modules.authorify-cfg-logger' class='name expandable'>logger</a> : Object<span class=\"signature\"></span></div><div class='description'><div class='short'>The logger. ...</div><div class='long'><p>The logger. It MUST have\nlog, error, warn, info, debug methods</p>\n<p>Defaults to: <code>console</code></p></div></div></div><div id='cfg-login' class='member not-inherited'><a href='#' class='side expandable'><span> </span></a><div class='title'><div class='meta'><span class='defined-in' rel='node_modules.authorify'>node_modules.authorify</span><br/><a href='source/default.html#node_modules-authorify-cfg-login' target='_blank' class='view-source'>view source</a></div><a href='#!/api/node_modules.authorify-cfg-login' class='name expandable'>login</a> : Function<span class=\"signature\"></span></div><div class='description'><div class='short'>The login handler. ...</div><div class='long'><p>The login handler. You MUST define your own login strategy.</p>\n\n<h2>Example</h2>\n\n<pre><code> var fs = require('fs'),\n authorify = require('auhtorify')({\n key: fs.readFileSync('serverCert.key'), 'utf8'),\n cert: fs.readFileSync('serverCert.cer'), 'utf8'),\n ca: fs.readFileSync('serverCA.cer'), 'utf8'),\n login: function(id, app, username, password, callback) {\n // manage id and app as your needs\n if (username === 'username' && password === 'password') {\n callback(1, ['admin']);\n } else if (username === 'user' && password === 'pass') {\n callback(2, ['user']);\n } else {\n callback(new Error('user and/or password wrong'));\n }\n }\n });\n</code></pre>\n<h3 class=\"pa\">Parameters</h3><ul><li><span class='pre'>id</span> : String<div class='sub-desc'><p>The id (uuid) assigned to the client</p>\n</div></li><li><span class='pre'>app</span> : String<div class='sub-desc'><p>The app (uuid) assigned to the application that the client want to use</p>\n</div></li><li><span class='pre'>username</span> : String<div class='sub-desc'><p>The username for the browser login</p>\n</div></li><li><span class='pre'>password</span> : String<div class='sub-desc'><p>The password for the browser login</p>\n</div></li><li><span class='pre'>callback</span> : Function<div class='sub-desc'><p>Function called when the identifier is created</p>\n<h3 class=\"pa\">Parameters</h3><ul><li><span class='pre'>err</span> : String/Error<div class='sub-desc'><p>Error if occurred</p>\n</div></li><li><span class='pre'>userId</span> : String<div class='sub-desc'><p>The user identifier</p>\n</div></li><li><span class='pre'>admins</span> : String/Array<div class='sub-desc'><p>The role/s of the user</p>\n</div></li></ul></div></li></ul><h3 class='pa'>Returns</h3><ul><li><span class='pre'>callback(err, userId, admins)</span><div class='sub-desc'><p>The callback to execute as result</p>\n</div></li></ul></div></div></div><div id='cfg-logoutPath' class='member not-inherited'><a href='#' class='side expandable'><span> </span></a><div class='title'><div class='meta'><span class='defined-in' rel='node_modules.authorify'>node_modules.authorify</span><br/><a href='source/default.html#node_modules-authorify-cfg-logoutPath' target='_blank' class='view-source'>view source</a></div><a href='#!/api/node_modules.authorify-cfg-logoutPath' class='name expandable'>logoutPath</a> : String<span class=\"signature\"></span></div><div class='description'><div class='short'>The route exposed by the server for the logout ...</div><div class='long'><p>The route exposed by the server for the logout</p>\n<p>Defaults to: <code>'/logout'</code></p></div></div></div><div id='cfg-persist' class='member not-inherited'><a href='#' class='side expandable'><span> </span></a><div class='title'><div class='meta'><span class='defined-in' rel='node_modules.authorify'>node_modules.authorify</span><br/><a href='source/default.html#node_modules-authorify-cfg-persist' target='_blank' class='view-source'>view source</a></div><a href='#!/api/node_modules.authorify-cfg-persist' class='name expandable'>persist</a> : Boolean<span class=\"signature\"></span></div><div class='description'><div class='short'>Persistence of token\nIf persist is false, the token (and it's session) will expire after the tokenTtl config. ...</div><div class='long'><p>Persistence of token\nIf persist is false, the token (and it's session) will expire after the tokenTtl config.\nIf persist is true, the token will never expire and tokenTtl config will be ignored.</p>\n<p>Defaults to: <code>false</code></p></div></div></div><div id='cfg-sessionStore' class='member not-inherited'><a href='#' class='side expandable'><span> </span></a><div class='title'><div class='meta'><span class='defined-in' rel='node_modules.authorify'>node_modules.authorify</span><br/><a href='source/default.html#node_modules-authorify-cfg-sessionStore' target='_blank' class='view-source'>view source</a></div><a href='#!/api/node_modules.authorify-cfg-sessionStore' class='name expandable'>sessionStore</a> : Object<span class=\"signature\"></span></div><div class='description'><div class='short'><p>The store for the sessions</p>\n</div><div class='long'><p>The store for the sessions</p>\n</div></div></div><div id='cfg-sidLength' class='member not-inherited'><a href='#' class='side expandable'><span> </span></a><div class='title'><div class='meta'><span class='defined-in' rel='node_modules.authorify'>node_modules.authorify</span><br/><a href='source/default.html#node_modules-authorify-cfg-sidLength' target='_blank' class='view-source'>view source</a></div><a href='#!/api/node_modules.authorify-cfg-sidLength' class='name expandable'>sidLength</a> : Integer<span class=\"signature\"></span></div><div class='description'><div class='short'>The number of characters to create the session ID. ...</div><div class='long'><p>The number of characters to create the session ID.</p>\n<p>Defaults to: <code>40</code></p></div></div></div><div id='cfg-sidTtl' class='member not-inherited'><a href='#' class='side expandable'><span> </span></a><div class='title'><div class='meta'><span class='defined-in' rel='node_modules.authorify'>node_modules.authorify</span><br/><a href='source/default.html#node_modules-authorify-cfg-sidTtl' target='_blank' class='view-source'>view source</a></div><a href='#!/api/node_modules.authorify-cfg-sidTtl' class='name expandable'>sidTtl</a> : Integer<span class=\"signature\"></span></div><div class='description'><div class='short'>The time to live for the handshake and authentication session in seconds ...</div><div class='long'><p>The time to live for the handshake and authentication session in seconds</p>\n<p>Defaults to: <code>300</code></p></div></div></div><div id='cfg-signBody' class='member not-inherited'><a href='#' class='side expandable'><span> </span></a><div class='title'><div class='meta'><span class='defined-in' rel='node_modules.authorify'>node_modules.authorify</span><br/><a href='source/default.html#node_modules-authorify-cfg-signBody' target='_blank' class='view-source'>view source</a></div><a href='#!/api/node_modules.authorify-cfg-signBody' class='name expandable'>signBody</a> : Boolean<span class=\"signature\"></span></div><div class='description'><div class='short'>Sign the body when it is sent encrypted ...</div><div class='long'><p>Sign the body when it is sent encrypted</p>\n<p>Defaults to: <code>true</code></p></div></div></div><div id='cfg-tokenTtl' class='member not-inherited'><a href='#' class='side expandable'><span> </span></a><div class='title'><div class='meta'><span class='defined-in' rel='node_modules.authorify'>node_modules.authorify</span><br/><a href='source/default.html#node_modules-authorify-cfg-tokenTtl' target='_blank' class='view-source'>view source</a></div><a href='#!/api/node_modules.authorify-cfg-tokenTtl' class='name expandable'>tokenTtl</a> : Integer<span class=\"signature\"></span></div><div class='description'><div class='short'>The time to live for the token and it's authorized session in seconds ...</div><div class='long'><p>The time to live for the token and it's authorized session in seconds</p>\n<p>Defaults to: <code>3600</code></p></div></div></div><div id='cfg-userIdFieldName' class='member not-inherited'><a href='#' class='side expandable'><span> </span></a><div class='title'><div class='meta'><span class='defined-in' rel='node_modules.authorify'>node_modules.authorify</span><br/><a href='source/default.html#node_modules-authorify-cfg-userIdFieldName' target='_blank' class='view-source'>view source</a></div><a href='#!/api/node_modules.authorify-cfg-userIdFieldName' class='name expandable'>userIdFieldName</a> : String<span class=\"signature\"></span></div><div class='description'><div class='short'>The field name used for the user identifier into the routes. ...</div><div class='long'><p>The field name used for the user identifier into the routes.</p>\n\n<h2>Example</h2>\n\n<pre><code> var restify = require('restify'),\n authorify = require('auhtorify')({\n userIdFieldName: 'myuser'\n // other options\n });\n server.get('/secure/user/:myuser', sec.isSelf(), ok);\n</code></pre>\n<p>Defaults to: <code>'user'</code></p></div></div></div></div></div><div class='members-section'><div class='definedBy'>Defined By</div><h3 class='members-title icon-property'>Properties</h3><div class='subsection'><div id='property-authentication' class='member first-child not-inherited'><a href='#' class='side expandable'><span> </span></a><div class='title'><div class='meta'><span class='defined-in' rel='node_modules.authorify'>node_modules.authorify</span><br/><a href='source/default.html#node_modules-authorify-property-authentication' target='_blank' class='view-source'>view source</a></div><a href='#!/api/node_modules.authorify-property-authentication' class='name expandable'>authentication</a> : function (req, res, next)<span class=\"signature\"></span></div><div class='description'><div class='short'>The authentication middleware. ...</div><div class='long'><p><a href=\"#!/api/node_modules.authorify.authentication\" rel=\"node_modules.authorify.authentication\" class=\"docClass\">The authentication middleware.</a></p>\n<h3 class=\"pa\">Parameters</h3><ul><li><span class='pre'>req</span> : IncomingMessage<div class='sub-desc'><p>Request</p>\n</div></li><li><span class='pre'>res</span> : ServerResponse<div class='sub-desc'><p>Response</p>\n</div></li><li><span class='pre'>next</span> : Function<div class='sub-desc'><p>The callback</p>\n<h3 class=\"pa\">Parameters</h3><ul><li><span class='pre'>err</span> : Error<div class='sub-desc'><p>The error instance if occurred</p>\n</div></li></ul></div></li></ul></div></div></div><div id='property-authorization' class='member not-inherited'><a href='#' class='side expandable'><span> </span></a><div class='title'><div class='meta'><span class='defined-in' rel='node_modules.authorify'>node_modules.authorify</span><br/><a href='source/default.html#node_modules-authorify-property-authorization' target='_blank' class='view-source'>view source</a></div><a href='#!/api/node_modules.authorify-property-authorization' class='name expandable'>authorization</a> : Object<span class=\"signature\"></span></div><div class='description'><div class='short'><p><a href=\"#!/api/node_modules.authorify.authorization\" rel=\"node_modules.authorify.authorization\" class=\"docClass\">The authorization middleware.</a></p>\n</div><div class='long'><p><a href=\"#!/api/node_modules.authorify.authorization\" rel=\"node_modules.authorify.authorization\" class=\"docClass\">The authorization middleware.</a></p>\n</div></div></div></div></div><div class='members-section'><div class='definedBy'>Defined By</div><h3 class='members-title icon-method'>Methods</h3><div class='subsection'><div id='method-load' class='member first-child not-inherited'><a href='#' class='side expandable'><span> </span></a><div class='title'><div class='meta'><span class='defined-in' rel='node_modules.authorify'>node_modules.authorify</span><br/><a href='source/default.html#node_modules-authorify-method-load' target='_blank' class='view-source'>view source</a></div><a href='#!/api/node_modules.authorify-method-load' class='name expandable'>load</a>( <span class='pre'>name, [shortname], [opts]</span> )<span class=\"signature\"></span></div><div class='description'><div class='short'>Load a plugin module to add some functionality. ...</div><div class='long'><p>Load a plugin module to add some functionality.</p>\n\n<h2>Example</h2>\n\n<pre><code> var authorify = require('auhtorify')({\n // add your options\n });\n authorify.load('pluginname', 'shortname', opts); // opts is an optional object to configure the plugin\n var loadedPlugin = authorify.plugin['shortname'];\n // below you can use all methods/properties exported by the plugin (loadedPlugin)\n</code></pre>\n<h3 class=\"pa\">Parameters</h3><ul><li><span class='pre'>name</span> : String<div class='sub-desc'><p>The name of the plugin. THe plugin must be installed into the\napplication folder that uses the authorify module.</p>\n</div></li><li><span class='pre'>shortname</span> : String (optional)<div class='sub-desc'><p>An optional short name for the plugin loaded as property in the root application\n(authorify.plugin['shortname']).</p>\n</div></li><li><span class='pre'>opts</span> : Object (optional)<div class='sub-desc'><p>The options required by the plugin.</p>\n</div></li></ul></div></div></div></div></div></div></div>","aliases":{},"files":[{"href":"default.html#node_modules-authorify","filename":"default.js"}]});