Skip to content

olssonsimon/simple-token-auth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

###Simple Token Auth Use this module to add a super simple layer of token based authentication.

###Installation

npm install simple-token-auth

var Auth = require('simple-token-auth');
var auth = Auth.init_with_token(auth_token);

###Setup

  1. Create a token
  2. Pass the token to the init_with_token call
  3. Set the token for the 'Authorization' parameter in the request header
  4. Make your requests

###Usage

####Use for all routes

app.all('*', auth.verify_token);

####Use for a specific route

app.get('/some/route', auth.verify_token, function(req, res) {
  // Do something
});

About

A very simple token based authentication solution for node.js

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published