Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
authorify-client
Advanced tools
Client for Authorify authorization and authentication system for REST server
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
authorify.set({
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) {
authorify.post('/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
:
$ ./build.sh
and add the obtained authorify.js
file to your html
file:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>authorify-client example</title>
</head>
<body>
<script src="authorify.js"></script>
<script src="example.js"></script>
</body>
</html>
The script example.js
contanins your example code:
// you have a global authorify variable
authorify.set({
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) {
authorify.post('/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.
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
$ ./gen_doc.sh
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:
For more convoluted language, see the LICENSE file.
FAQs
Client for Authorify authorization and authentication system for REST server
The npm package authorify-client receives a total of 1 weekly downloads. As such, authorify-client popularity was classified as not popular.
We found that authorify-client demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.