Skip to content

Commit

Permalink
Merge pull request #4 from raboof/opaque
Browse files Browse the repository at this point in the history
Thanks!
  • Loading branch information
inorganik committed Aug 4, 2014
2 parents bee9ea4 + f268b7d commit 9c99aec
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions digestAuthRequest.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ function digestAuthRequest(method, url, username, password) {
this.realm = null; // server issued realm
this.qop = null; // "quality of protection" - '' or 'auth' or 'auth-int'
this.response = null; // hashed response to server challenge
this.opaque = null; // hashed response to server challenge
this.nc = 1; // nonce count - increments with each request used with the same nonce
this.cnonce = null; // client nonce

Expand Down Expand Up @@ -83,6 +84,10 @@ function digestAuthRequest(method, url, username, password) {
if (key.match(/nonce/i) != null) {
self.nonce = val;
}
// find opaque
if (key.match(/opaque/i) != null) {
self.opaque = val;
}
// find QOP
if (key.match(/qop/i) != null) {
self.qop = val;
Expand Down Expand Up @@ -130,6 +135,7 @@ function digestAuthRequest(method, url, username, password) {
'nonce="'+self.nonce+'", '+
'uri="'+url+'", '+
'response="'+self.response+'", '+
'opaque="'+self.opaque+'", '+
'qop='+self.qop+', '+
'nc='+('00000000' + self.nc).slice(-8)+', '+
'cnonce="'+self.cnonce+'"';
Expand Down

0 comments on commit 9c99aec

Please sign in to comment.