www-authenticate
Advanced tools
Comparing version 0.1.1 to 0.2.0
@@ -30,6 +30,6 @@ | ||
if (options) { | ||
if (options.cnonce) | ||
if (toString.call(options.cnonce) == '[object String]') | ||
cnonce= options.cnonce; | ||
} | ||
if (!cnonce) cnonce= crypto.pseudoRandomBytes(8); | ||
if (cnonce === void 0) cnonce= crypto.pseudoRandomBytes(8).toString('hex'); | ||
return function parse_header(www_authenticate) | ||
@@ -52,3 +52,7 @@ { | ||
case 'Basic': | ||
var auth_string= 'Basic '+new Buffer(username+':'+password || "", "ascii").toString("base64"); | ||
var auth_string= | ||
password !== '' && !password && options.password_optional? | ||
'Basic '+new Buffer(username, "ascii").toString("base64") | ||
: | ||
'Basic '+new Buffer(username+':'+password, "ascii").toString("base64") | ||
this.authorize= function() { | ||
@@ -64,3 +68,7 @@ return auth_string; | ||
var ha1= md5(username+':'+realm+':'+password); | ||
var ha1= | ||
password !== '' && !password && options.password_optional? | ||
md5(username+':'+realm) | ||
: | ||
md5(username+':'+realm+':'+password) | ||
var nonce= auth_parms.nonce; | ||
@@ -92,3 +100,3 @@ if (!nonce) { | ||
if (algorithm) { | ||
fixed+= ', algorithm="'+algorithm+'"'; | ||
fixed+= ' algorithm="'+algorithm+'",'; | ||
} | ||
@@ -95,0 +103,0 @@ else { |
{ | ||
"name": "www-authenticate", | ||
"description": "Provides the functionality needed for a client to use HTTP Basic or Digest authentication. Also provides primitives for parsing WWW-Authenticate and Authentication_Info headers.", | ||
"version": "0.1.1", | ||
"version": "0.2.0", | ||
"homepage": "https://github.com/randymized/www-authenticate", | ||
@@ -6,0 +6,0 @@ "author": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13834
287