Skip to content
Open
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
7 changes: 5 additions & 2 deletions lib/oauth.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ var crypto= require('crypto'),
querystring= require('querystring'),
OAuthUtils= require('./_utils');

exports.OAuth= function(requestUrl, accessUrl, consumerKey, consumerSecret, version, authorize_callback, signatureMethod, nonceSize, customHeaders) {
exports.OAuth= function(requestUrl, accessUrl, consumerKey, consumerSecret, version, authorize_callback, signatureMethod, nonceSize, customHeaders, realm) {
this._isEcho = false;

this._requestUrl= requestUrl;
Expand All @@ -31,6 +31,9 @@ exports.OAuth= function(requestUrl, accessUrl, consumerKey, consumerSecret, vers
this._headers= customHeaders || {"Accept" : "*/*",
"Connection" : "close",
"User-Agent" : "Node authentication"}

this._realm = realm;

this._clientOptions= this._defaultClientOptions= {"requestTokenHttpMethod": "POST",
"accessTokenHttpMethod": "POST",
"followRedirects": true};
Expand Down Expand Up @@ -119,7 +122,7 @@ exports.OAuth.prototype._isParameterNameAnOAuthParameter= function(parameter) {
// build the OAuth request authorization header
exports.OAuth.prototype._buildAuthorizationHeaders= function(orderedParameters) {
var authHeader="OAuth ";
if( this._isEcho ) {
if( this._isEcho || this._realm ) {
authHeader += 'realm="' + this._realm + '",';
}

Expand Down