All Projects → gevorg → http-auth

gevorg / http-auth

Licence: MIT License
Node.js package for HTTP basic and digest access authentication.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to http-auth

Http Auth
Node.js package for HTTP basic and digest access authentication.
Stars: ✭ 355 (-2.47%)
Mutual labels:  protection, mocha, realm, passport, digest
seedpress-cms
A headless CMS built in Express for PostgresQL using Sequelize. Generally follows the Wordpress post and term schema.
Stars: ✭ 71 (-80.49%)
Mutual labels:  mocha, passport
express-mysql-rest
Building the simple api with sequelize, mysql and express js. this repository contains the code about how to use sequelize with mysql at express js. for example i have provide the crud operation to this repository. You can also testing the api with chai and mocha with chai-http by this repository
Stars: ✭ 25 (-93.13%)
Mutual labels:  mocha
node-facebook-twitter-google-github-login
Node, Express, Mongoose, Passport, Facebook, Twitter, Google and Github Authentication (Login)
Stars: ✭ 31 (-91.48%)
Mutual labels:  passport
tropic
🍍 Test Runner Library
Stars: ✭ 29 (-92.03%)
Mutual labels:  mocha
QKMRZScanner
Scan MRZ (Machine Readable Zone) from identity documents (passport, id, visa) using iPhone/iPad (iOS)
Stars: ✭ 81 (-77.75%)
Mutual labels:  passport
guardian
A free, open-source, and feature-rich modification for the Attack on Titan Tribute Game (AoTTG).
Stars: ✭ 12 (-96.7%)
Mutual labels:  protection
php-csrf
Single PHP library file for protection over Cross-Site Request Forgery
Stars: ✭ 44 (-87.91%)
Mutual labels:  protection
figma-export
Export tool for Figma. You can easily and automatically export your Figma components and use them directly into your website.
Stars: ✭ 99 (-72.8%)
Mutual labels:  mocha
react-isomorphic-bundle
React Redux Universal (isomorphic) bundle
Stars: ✭ 53 (-85.44%)
Mutual labels:  passport
nestjs-auth0
An example NestJS application that uses Auth0 via Passport for authentication.
Stars: ✭ 148 (-59.34%)
Mutual labels:  passport
TogetherStream
A social and synchronized streaming experience
Stars: ✭ 16 (-95.6%)
Mutual labels:  passport
laravel8-passport-fcm-api
Live streaming gigs mobile app RESTful API endpoints
Stars: ✭ 13 (-96.43%)
Mutual labels:  passport
nodejs-application-architecture
👨‍🔧 A discussion on how Node.js projects can be organized.
Stars: ✭ 81 (-77.75%)
Mutual labels:  mocha
todoapp-reactnative-realm
Todo App with React Native, Realm
Stars: ✭ 28 (-92.31%)
Mutual labels:  realm
RealmSwiftService
Support Realm CRUD functions. Support Dao Object and Protocol Extension.
Stars: ✭ 12 (-96.7%)
Mutual labels:  realm
react-innertext
Returns the innerText of a React JSX object.
Stars: ✭ 37 (-89.84%)
Mutual labels:  mocha
RxRealm
Utilities for using RxJava with Realm
Stars: ✭ 23 (-93.68%)
Mutual labels:  realm
chai-passport-strategy
Helpers for testing Passport strategies with the Chai assertion library.
Stars: ✭ 32 (-91.21%)
Mutual labels:  passport
cypress-mochawesome-reporter
Zero config Mochawesome reporter for Cypress with screenshots
Stars: ✭ 48 (-86.81%)
Mutual labels:  mocha

http-auth

Node.js package for HTTP basic and digest access authentication.

build

Installation

Via git (or downloaded tarball):

$ git clone git://github.com/gevorg/http-auth.git

Via npm:

$ npm install http-auth

Usage

// HTTP module
const http = require("http");

// Authentication module.
const auth = require("http-auth");
const basic = auth.basic({
  realm: "Simon Area.",
  file: __dirname + "/../data/users.htpasswd" // gevorg:gpass, Sarah:testpass
});

// Creating new HTTP server.
http
  .createServer(
    basic.check((req, res) => {
      res.end(`Welcome to private area - ${req.user}!`);
    })
  )
  .listen(1337, () => {
    // Log URL.
    console.log("Server running at http://127.0.0.1:1337/");
  });

Please check examples directory for more.

Configurations

  • realm - Authentication realm, by default it is Users.
  • file - File where user details are stored.
    • Line format is {user:pass} or {user:passHash} for basic access.
    • Line format is {user:realm:passHash} for digest access.
  • algorithm - Algorithm that will be used only for digest access authentication.
    • MD5 by default.
    • MD5-sess can be set.
  • qop - Quality of protection that is used only for digest access authentication.
    • auth is set by default.
    • none this option is disabling protection.
  • msg401 - Message for failed authentication 401 page.
  • msg407 - Message for failed authentication 407 page.
  • contentType - Content type for failed authentication page.
  • skipUser - Set this to true, if you don't want req.user to be filled with authentication info.
  • proxy - Set this to true, if you want to use it with http-proxy.

Running tests

It uses mocha, so just run following command in package directory:

$ npm test

Questions

You can also use stackoverflow to ask questions using http-auth tag.

Utilities

  • htpasswd - Node.js package for HTTP Basic Authentication password file utility.
  • htdigest - Node.js package for HTTP Digest Authentication password file utility.

Integrations

Please check this link for integration packages.

License

The MIT License (MIT)

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].