node-basic-auth
Basic authentication parser for NodeJS Projects. Supports domain/team specific basic authentication.
Example format
domain\\name:pass// =>// => abc\\mike:test => { domain: 'abc', name: 'mike', pass: 'test' }
Installation
$ npm install node-basic-auth
Import
var bAuth =
Usage
var bAuth = var cred = // => { domain: 'abc', name: 'mike', pass: 'test' }
Usage using expressJS
var express = ;var app = ;var bAuth = ;appapp;
Special cases
Without domain
\\mike:test// => {domain: '', name: 'mike', pass: 'test'}
Without password
abc\\mike:// => {domain: 'abc', name: 'mike', pass: ''}