This example demonstrates how to use Express 3.x and Passport to authenticate users via either the HTTP Basic or HTTP Digest schemes. Use this example as a starting point for your own web applications.
To install this example on your computer, clone the repository and install dependencies.
$ git clone [email protected]:passport/express-3.x-http-basic-and-digest-example.git
$ cd express-3.x-http-basic-and-digest-example
$ npm install
Start the server.
$ node server.js
Use curl
to send an authenticated request using HTTP Basic scheme.
$ curl -v --user jack:secret --basic http://127.0.0.1:3000/
Use curl
to send an authenticated request using HTTP Digest scheme.
$ curl -v --user jack:secret --digest http://127.0.0.1:3000/