Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue 18 fixed - allow empty cnonce.
- Loading branch information
Showing
4 changed files
with
62 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/** | ||
* HTTP authentication module. | ||
*/ | ||
var auth = require('../lib/http-auth'); | ||
|
||
/** | ||
* HTTP module. | ||
*/ | ||
var http = require('http'); | ||
|
||
/** | ||
* Requesting new authentication instance. | ||
*/ | ||
var digest = auth({ | ||
authRealm : "Private area.", | ||
// username is mia, password is supergirl. | ||
authList : ['mia:Private area.:3a556dc7260e8e7f032d247fb668b06b'], | ||
authType : 'digest' | ||
}); | ||
|
||
/** | ||
* Creating new HTTP server. | ||
*/ | ||
http.createServer(function(req, res) { | ||
// Apply authentication to server. | ||
digest.apply(req, res, function(username) { | ||
res.end("Welcome to private area - " + username + "!"); | ||
}); | ||
}).listen(1337); | ||
|
||
// Log url. | ||
console.log("Server running at http://127.0.0.1:1337/"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters