fluent / fluent-logger-node

A structured logger for Fluentd (Node.js)
Apache License 2.0
259 stars 83 forks source link

Username Password based authentication doesn't work #128

Closed JvalantPatel-MS closed 5 years ago

JvalantPatel-MS commented 5 years ago
Description:
After checking the **HELO** message, if user based authentication
is enabled at server side fluentd process then it passes the
buffer in the response as 'auth' property.

Currently, while generating **PING** message, the client is not passing
the username value correctly (it is being passed as null always)
and due to that server is refusing the connection with below error:
Authentication failed: username/password mismatch

Solution:
Fix the reference to the username.

Possible fix would be:

diff --git a/lib/sender.js b/lib/sender.js index e4888cb..bda1e11 100644 --- a/lib/sender.js +++ b/lib/sender.js @@ -500,7 +500,7 @@ class FluentSender { .update(this.security.username || '') .update(this.security.password || '') .digest('hex'); - ping.push(this.username, passwordHexDigest); + ping.push(this.security.username, passwordHexDigest); } else { ping.push('', ''); }

The above diff is based on the master head commit - https://github.com/fluent/fluent-logger-node/commit/b54cb585a433983091b3bb6825494ef06d5ca921

okkez commented 5 years ago

Thank you for your patch. I'm checking your patch.