From 1d2ddd0ccc94a6d15b40181883d3063de7c92fc1 Mon Sep 17 00:00:00 2001 From: Jeff Levensailor Date: Fri, 11 May 2018 12:23:26 -0700 Subject: [PATCH 1/3] Update http.js Added Basic Authentication in "Authorization: Basic " --- lib/handlers/client/http.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/handlers/client/http.js b/lib/handlers/client/http.js index 13f490b..279be38 100644 --- a/lib/handlers/client/http.js +++ b/lib/handlers/client/http.js @@ -11,6 +11,7 @@ HttpClientHandler.prototype.send = function(ctx, callback) { , headers: { "SOAPAction": ctx.action , "Content-Type": ctx.contentType , "MIME-Version": "1.0" + , "Authorization": ctx.authorization } , encoding: null , rejectUnauthorized: false @@ -28,4 +29,4 @@ HttpClientHandler.prototype.send = function(ctx, callback) { else ctx.statusCode = response.statusCode callback(ctx) }) -} \ No newline at end of file +} From 0afbc04f56bf1f5b014eff224cad2dca65adc86e Mon Sep 17 00:00:00 2001 From: Jeff Levensailor Date: Fri, 11 May 2018 12:25:43 -0700 Subject: [PATCH 2/3] Basic Authorization examples Added examples of Basic Authentication via Auth Token --- README.md | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 76d4b11..bcc7c11 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,9 @@ Install with [npm](http://github.com/isaacs/npm): , Http = ws.Http , Security = ws.Security , UsernameToken = ws.UsernameToken - + + var authToken = new Buffer(user + ':' + pass).toString('base64'); + var request = '' + '
' + '' + @@ -37,6 +39,7 @@ Install with [npm](http://github.com/isaacs/npm): , url: "http://service/security" , action: "http://tempuri.org/EchoString" , contentType: "text/xml" + , authorization: "Basic: "+authToken" } @@ -337,7 +340,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI ### More details * [http://webservices20.blogspot.com/](http://webservices20.blogspot.com/) * Or drop me an [email](mailto:yaronn01@gmail.com) - - -[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/yaronn/ws.js/trend.png)](https://bitdeli.com/free "Bitdeli Badge") - + + +[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/yaronn/ws.js/trend.png)](https://bitdeli.com/free "Bitdeli Badge") + From f735dd6eb20438266fc51d093dcad5c7f5b363bd Mon Sep 17 00:00:00 2001 From: Jeff Levensailor Date: Tue, 26 May 2020 05:49:59 -0700 Subject: [PATCH 3/3] Fixed authorization formatting --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index bcc7c11..d56b471 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ Install with [npm](http://github.com/isaacs/npm): , url: "http://service/security" , action: "http://tempuri.org/EchoString" , contentType: "text/xml" - , authorization: "Basic: "+authToken" + , authorization: "Basic: "+authToken }