Skip to content

Commit

Permalink
Merge pull request #411 from kjdelisle/protocol/aws-mechanism-fix
Browse files Browse the repository at this point in the history
fix: use correct mechanism name for broker compatibility
  • Loading branch information
tulios authored Jun 27, 2019
2 parents fd13841 + e59a416 commit fcfeef6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions docs/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ Refer to [TLS create secure context](https://nodejs.org/dist/latest-v8.x/docs/ap
Kafka has support for using SASL to authenticate clients. The `sasl` option can be used to configure the authentication mechanism. Currently, KafkaJS supports `PLAIN`, `SCRAM-SHA-256`, `SCRAM-SHA-512`, and `AWS-IAM` mechanisms.

### PLAIN/SCRAM Example

```javascript
new Kafka({
clientId: 'my-app',
Expand All @@ -62,7 +63,7 @@ new Kafka({
brokers: ['kafka1:9092', 'kafka2:9092'],
// authenticationTimeout: 1000,
sasl: {
mechanism: 'aws-iam',
mechanism: 'aws',
authorizationIdentity: 'AIDAIOSFODNN7EXAMPLE', // UserId or RoleId
accessKeyId: 'AKIAIOSFODNN7EXAMPLE',
secretAccessKey: 'wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY',
Expand Down Expand Up @@ -91,7 +92,7 @@ A complete breakdown can be found in the IAM User Guide's

### Use Encrypted Protocols

It is __highly recommended__ that you use SSL for encryption when using `PLAIN` or `AWS`,
It is **highly recommended** that you use SSL for encryption when using `PLAIN` or `AWS`,
otherwise credentials will be transmitted in cleartext!

## Connection Timeout
Expand Down
2 changes: 1 addition & 1 deletion src/broker/saslAuthenticator/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const AUTHENTICATORS = {
PLAIN: PlainAuthenticator,
'SCRAM-SHA-256': SCRAM256Authenticator,
'SCRAM-SHA-512': SCRAM512Authenticator,
'AWS-IAM': AWSIAMAuthenticator,
AWS: AWSIAMAuthenticator,
}

const SUPPORTED_MECHANISMS = Object.keys(AUTHENTICATORS)
Expand Down

0 comments on commit fcfeef6

Please sign in to comment.