node package manager


Authorify Client

This is the client for our Authorify authentication and authorization middleware for a REST server.


Install authorify-client as usual:

$ npm install --save authorify-client


You can use authorify-client both in node and in browser environment.


This client has the same approach of superagent and you can use it as shown below:

// dependencies 
var fs = require('fs'),
    authorify = require('authorify-client')({
      host: 'localhost',
      debug: true,
      key: fs.readFileSync('clientCert.key'), 'utf8'),
      cert: fs.readFileSync('clientCert.cer'), 'utf8'),
      ca: fs.readFileSync('serverCA.cer'), 'utf8')
    uuid = require('node-uuid'),
    id = uuid.v4(),
    app = uuid.v4();
// set a configuration 
  host: 'localhost',    // host of your server 
  port: 3000,           // port of your server 
  id: id,               // a valid uuid 
  app: app              // another valid uuid 
// login 
authorify.login('username', 'password', function(err, res) {'/test')
    // send a message into the body 
    .send({ name: 'alex', surname: 'smith' })
    .end(function(err, res) {
      if (!err) {
        // your logic here 


To create a single file to use in browser environment use a simple script that uses browserify:

$ ./

and add the obtained authorify.js file to your html file:

<!DOCTYPE html>
        <meta charset="utf-8">
        <title>authorify-client example</title>
        <script src="authorify.js"></script> 
        <script src="example.js"></script> 

The script example.js contanins your example code:

// you have a global authorify variable  
  host: 'localhost',                            // host of your server 
  port: 3000,                                   // port of your server 
  id: 'ae92d22b-a9ab-458a-9850-0025dbf11fad',   // a valid uuid 
  app: 'c983659a-9572-4471-a3a2-7d45b591d315'   // another valid uuid 
// login 
authorify.login('username', 'password', function(err, res) {'/test')
    // send a message into the body 
    .send({ name: 'alex', surname: 'smith' }))
    .end(function(err, res) {
      if (!err) {
        // your logic here 

See Authorify test/browser folder to see more examples.

Run Tests

As usual we use mocha as test framework and you can run all tests simply typing:

$ npm test

For other tests (for node and browser) please read Authorify documentation and the local documentation into doc folder.


To create your own documentation you must install JSDuck and type in your terminal:

$ cd /path-of-package
$ ./

See full documentation into doc folder.


The version number is laid out as: major.minor.patch and tries to follow semver as closely as possible but this is how we use our version numbering:


A major and possible breaking change has been made in the authorify core. These changes could be not backwards compatible with older versions.


New features are added or a big change has happened with one of the third party libraries.


A bug has been fixed, without any major internal and breaking changes.


To contribute to the project follow the GitHub guidelines.


This program is released under a GNU Affero General Public License version 3 or above, which in summary means:

  • You can use this program for no cost.
  • You can use this program for both personal and commercial reasons.
  • You do not have to share your own program's code which uses this program.
  • You have to share modifications (e.g bug-fixes) you've made to this program.

For more convoluted language, see the LICENSE file.