# Opendistro - kafka connect

**URL:** <https://forum.opensearch.org/t/opendistro-kafka-connect/7203>\
**Category:** General Feedback\
**Created:** [October 6, 2021, 12:18pm UTC](https://forum.opensearch.org/t/opendistro-kafka-connect/7203 "2021-10-06T12:18:33Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![idanl](https://avatars.discourse-cdn.com/v4/letter/i/278dde/32.png) [@idanl](https://forum.opensearch.org/u/idanl)\
**Post date:** [October 6, 2021, 12:18pm UTC](https://forum.opensearch.org/t/opendistro-kafka-connect/7203/1 "2021-10-06T12:18:33Z")

</div>

Hi, im tyring to use kafka-connect with open distro, I’m using the es-sink-connector.  
i get an erorr: `java.lang.IllegalStateException: Not a JSON Object: "Unauthorized"`.  
I’m using the admin user to access from the connector, but the same error.  
i saw on few blogs that there is a problem to connect kafka-connect-es-sink and open-distro, is it true?  
thanksss!

---

<div class="post-metadata">

**Author:** ![searchymcsearchface](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/searchymcsearchface/32/868_2.png) [@searchymcsearchface](https://forum.opensearch.org/u/searchymcsearchface)\
**Post date:** [October 6, 2021, 2:44pm UTC](https://forum.opensearch.org/t/opendistro-kafka-connect/7203/2 "2021-10-06T14:44:08Z")

</div>

I haven’t heard that but from the documentation it seems like it should work - it certainly looks you’re not passing your credentials from the error message.

---

<div class="post-metadata">

**Author:** ![idanl](https://avatars.discourse-cdn.com/v4/letter/i/278dde/32.png) [@idanl](https://forum.opensearch.org/u/idanl)\
**Post date:** [October 10, 2021, 8:34am UTC](https://forum.opensearch.org/t/opendistro-kafka-connect/7203/3 "2021-10-10T08:34:56Z")

</div>

yes, it bit wired, that is the connector that i’m creating :  
curl -X POST [http://localhost:8083/connectors](http://localhost:8083/connectors) -H “Content-Type: application/json” -d ‘{  
“name”: “simple-elasticsearch-connector2”,  
“config”: {  
“connector.class”: “io.confluent.connect.elasticsearch.ElasticsearchSinkConnector”,  
“connection.url”: “[http://od-master.internal:9200](http://od-master.internal:9200)”,  
“tasks.max”: “1”,  
“topics”: “test”,  
“key.ignore”: “true”,  
“name”: “simple-elasticsearch-connector2”,  
“connection.username”: “admin”,  
“connection.password”: “admin”,  
“value.converter”: “org.apache.kafka.connect.json.JsonConverter”,  
“value.converter.schemas.enable”: “false”,  
“schema.ignore”: “true”,  
“type.name”: “\_doc”  
} }’

(my admin user is admin:admin)

---

<div class="post-metadata">

**Author:** ![searchymcsearchface](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/searchymcsearchface/32/868_2.png) [@searchymcsearchface](https://forum.opensearch.org/u/searchymcsearchface)\
**Post date:** [October 12, 2021, 4:28pm UTC](https://forum.opensearch.org/t/opendistro-kafka-connect/7203/4 "2021-10-12T16:28:50Z")

</div>

`“connection.url”: “http://od-master.internal:9200”,`

Shouldn’t that be http **s**?

---

<div class="post-metadata">

**Author:** ![mann](https://avatars.discourse-cdn.com/v4/letter/m/91b2a8/32.png) [@mann](https://forum.opensearch.org/u/mann)\
**Post date:** [December 26, 2021, 3:49pm UTC](https://forum.opensearch.org/t/opendistro-kafka-connect/7203/5 "2021-12-26T15:49:55Z")

</div>

@searchymcsearchface @pablo @idanl I am trying to do same thing, with kafka-connect-opensearch, but I have also enable the SASL\_PLAINTEXT authentication, so while creating new connector using kafka connect REST API, it showing authentication failed.

Need to understand what key - value pair I need to pass as a json body for SASL\_PLAINTEXT authentication? Currently my JSON Body is -

```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:** ![searchymcsearchface](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/searchymcsearchface/32/868_2.png) [@searchymcsearchface](https://forum.opensearch.org/u/searchymcsearchface)\
**Post date:** [January 3, 2022, 4:10pm UTC](https://forum.opensearch.org/t/opendistro-kafka-connect/7203/6 "2022-01-03T16:10:38Z")

</div>

I’m not an expert on this part of the OpenSearch. You might want to cross post it in the security category for more visibility.

---

<div class="post-metadata">

**Author:** ![mann](https://avatars.discourse-cdn.com/v4/letter/m/91b2a8/32.png) [@mann](https://forum.opensearch.org/u/mann)\
**Post date:** [January 3, 2022, 6:34pm UTC](https://forum.opensearch.org/t/opendistro-kafka-connect/7203/7 "2022-01-03T18:34:18Z")

</div>

Ok, thanks for the direction.
