June 2014
Intermediate to advanced
696 pages
38h 52m
English
Another common use for Express middleware is to apply basic HTTP authentication. HTTP authentication uses the Authorization header to send an encoded username and password from a browser to a server. If no authorization information is stored in the browser for the URL, the browser launches a basic login dialog box to allow the user to enter the username and password. Basic HTTP authentication works well for basic sites that require a minimal authenticate method and is very easy to implement.
The basic-auth-connect middleware function in Express provides the support to handle basic HTTP authentication. The basic-auth-connect middleware uses the following syntax:
var basicAuth = ...
Read now
Unlock full access