Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass on 'opaque' field #4

Merged
merged 1 commit into from
Aug 4, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion 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 Expand Up @@ -204,4 +210,4 @@ function digestAuthRequest(method, url, username, password) {
if (self.request.readyState != 4) self.request.abort();
}
}
}
}