# SASL\_PLAINTEXT Authentication Failed - Kafka Connect Opensearch Plugin

**URL:** <https://forum.confluent.io/t/sasl-plaintext-authentication-failed-kafka-connect-opensearch-plugin/3762>\
**Category:** Kafka Connect\
**Created:** [26 December 2021 16:19 UTC](https://forum.confluent.io/t/sasl-plaintext-authentication-failed-kafka-connect-opensearch-plugin/3762 "2021-12-26T16:19:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mann2108](https://avatars.discourse-cdn.com/v4/letter/m/ad7895/32.png) [@mann2108](https://forum.confluent.io/u/mann2108)\
**Post date:** [26 December 2021 16:19 UTC](https://forum.confluent.io/t/sasl-plaintext-authentication-failed-kafka-connect-opensearch-plugin/3762/1 "2021-12-26T16:19:06Z")

</div>

I am using the Kafka Connect OpenSearch plugin with SASL\_PLAINTEXT authentication, while creating a new connector with REST API, I am not able to authenticate created connector, and it’s throwing an error - Authentication Failed while SASL handshake.

I need to understand what key-value pairs I need to pass along with JSON body that is relevant to SASL authentication.

I am sharing the JSON body which I am using while creating a new Connector with REST API -  
POST - [http://10.30.1.101:8083/connectors](http://10.30.1.101:8083/connectors)

```auto
{
    "name": "first-opensearch-connector",
    "config": {
        "name": "first-opensearch-connector",
        "connector.class": "com.dmathieu.kafka.opensearch.OpenSearchSinkConnector",
        "type.name": "_doc",
        "connection.password": "admin",
        "connection.username": "admin",
        "connection.url": "http://10.30.1.101:9200",
        "topics": "my_topic",
        "value.converter": "org.apache.kafka.connect.json.JsonConverter",
        "value.converter.schemas.enable": "false",
        "tasks.max": "1",
        "key.ignore": "true",
        "schema.ignore": "true",
        "drop.invalid.message":"true",
        "behavior.on.malformed.documents":"fail",
        "write.method":"INSERT",
        "read.timeout.ms":"10000",
        "errors.log.enable": "true",
        "errors.log.include.messages": "true",
        "errors.tolerance": "all",
        "transforms":"AddPrefix,TimestampRouter,InsertField",
        "transforms.AddPrefix.type":"org.apache.kafka.connect.transforms.RegexRouter",
        "transforms.AddPrefix.regex":".*",
        "transforms.AddPrefix.replacement":"acme_$0",
        "transforms.TimestampRouter.type": "org.apache.kafka.connect.transforms.TimestampRouter",
        "transforms.TimestampRouter.topic.format": "foo-bar-${topic}-${timestamp}",
        "transforms.TimestampRouter.timestamp.format": "YYYYMMdd",
        "transforms.InsertField.type": "org.apache.kafka.connect.transforms.InsertField$Value",
        "transforms.InsertField.static.field": "MessageSource",
        "transforms.InsertField.static.value": "Kafka Connect framework",
        "sasl.mechanism": "PLAIN",
        "security.protocol": "SASL_PLAINTEXT",
        "sasl.jaas.config": "org.apache.kafka.common.security.plain.PlainLoginModule required username=\"admin\" password=\"admin-secret\""
    }
}

```

---

<div class="post-metadata">

**Author:** ![mann2108](https://avatars.discourse-cdn.com/v4/letter/m/ad7895/32.png) [@mann2108](https://forum.confluent.io/u/mann2108)\
**Post date:** [26 December 2021 16:19 UTC](https://forum.confluent.io/t/sasl-plaintext-authentication-failed-kafka-connect-opensearch-plugin/3762/2 "2021-12-26T16:19:44Z")

</div>

@rmoff Can you help me in this?

---

<div class="post-metadata">

**Author:** ![rick](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.confluent.io/rick/32/49_2.png) [@rick](https://forum.confluent.io/u/rick)\
**Post date:** [28 December 2021 16:36 UTC](https://forum.confluent.io/t/sasl-plaintext-authentication-failed-kafka-connect-opensearch-plugin/3762/3 "2021-12-28T16:36:20Z")

</div>

@mann2108 I see you’ve posted an issue here: [SASL\_PLAINTEXT - Help Needed - Authentication getting failed with connector. · Issue #41 · dmathieu/kafka-connect-opensearch · GitHub](https://github.com/dmathieu/kafka-connect-opensearch/issues/41)

It’s not completely clear to me where you are seeing authentication issues.

For the Connect Worker to Kafka authentication you can provide the SASL details in the connect worker configuration file (`connect-distributed.properties` per your GH issue). In your GH issue you attempt to provide them in the JSON config payload, but that shouldn’t be necessary (and the format is incorrect, as you break up the `sasl.jaas.config` value).

Can you provide more clarity where exactly you are seeing this (how are you seeing it, which component is logging it, and any additional context around it)?

> [@mann2108](#):
>
> and it’s throwing an error - Authentication Failed while SASL handshake.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex019/uploads/confluentcommunity/original/1X/c49438c90c9df282e9996fdf6971be890c71b65a.svg) [@system](https://forum.confluent.io/u/system)\
**Post date:** [27 January 2022 16:36 UTC](https://forum.confluent.io/t/sasl-plaintext-authentication-failed-kafka-connect-opensearch-plugin/3762/4 "2022-01-27T16:36:37Z")

</div>

Closed on 27 January 2022 16:36 UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
