# Logstash Kafka input and output with oauth

**URL:** https://discuss.elastic.co/t/logstash-kafka-input-and-output-with-oauth/304886
**Category:** Logstash
**Created:** [May 17, 2022, 5:13am UTC](https://discuss.elastic.co/t/logstash-kafka-input-and-output-with-oauth/304886 "2022-05-17T05:13:59Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Jockj](https://avatars.discourse-cdn.com/v4/letter/j/3ec8ea/32.png) [@Jockj](https://discuss.elastic.co/u/Jockj)
#### Post date: [May 17, 2022, 5:13am UTC](https://discuss.elastic.co/t/logstash-kafka-input-and-output-with-oauth/304886/1 "2022-05-17T05:13:59Z")

</div>

Does anyone know how to use the logstash Kafka input/output plugin with oauth2? I couldn't find any settings with the current plugins. and I'm trying to develop one with the Kafka Java client. It failed with the following message. If I remove the oauth, it works.  
I guess the Threads are interrupt by logstash plugin code. But I don't know it yet.

[INFO] 2022-05-17 04:54:52.933 [Converge PipelineAction::Create] ExpiringCredentialRefreshingLogin - Successfully logged in.  
[INFO] 2022-05-17 04:54:52.938 [kafka-expiring-relogin-thread-C5191a3aeeeebd935fb1d9b5aaf86959cc15ca3e56f7b614ed5328febb0871317] ExpiringCredentialRefreshingLogin - [Principal=:C5191a3aeeeebd935fb1d9b5aaf86959cc15ca3e56f7b614ed5328febb0871317]: Expiring credential re-login thread started.  
[INFO] 2022-05-17 04:54:52.939 [kafka-expiring-relogin-thread-C5191a3aeeeebd935fb1d9b5aaf86959cc15ca3e56f7b614ed5328febb0871317] ExpiringCredentialRefreshingLogin - [Principal=C5191a3aeeeebd935fb1d9b5aaf86959cc15ca3e56f7b614ed5328febb0871317]: Expiring credential valid from 2022-05-17T04:54:52.338+0000 to 2022-05-17T22:54:51.338+0000  
[INFO] 2022-05-17 04:54:52.940 [kafka-expiring-relogin-thread-C5191a3aeeeebd935fb1d9b5aaf86959cc15ca3e56f7b614ed5328febb0871317] ExpiringCredentialRefreshingLogin - [Principal=:C5191a3aeeeebd935fb1d9b5aaf86959cc15ca3e56f7b614ed5328febb0871317]: Expiring credential re-login sleeping until: 2022-05-17T19:44:06.124+0000  
[INFO] 2022-05-17 04:54:52.941 [kafka-expiring-relogin-thread-C5191a3aeeeebd935fb1d9b5aaf86959cc15ca3e56f7b614ed5328febb0871317] ExpiringCredentialRefreshingLogin - [Principal=:C5191a3aeeeebd935fb1d9b5aaf86959cc15ca3e56f7b614ed5328febb0871317]: Expiring credential re-login thread has been interrupted and will exit.  
[INFO] 2022-05-17 04:54:52.943 [Converge PipelineAction::Create] KafkaProducer - [Producer clientId=esbtpt1ecd002] Closing the Kafka producer with timeoutMillis = 0 ms.

---

<div class="post-metadata">

### Author: ![Rios](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rios/32/95745_2.png) [@Rios](https://discuss.elastic.co/u/Rios)
#### Post date: [May 17, 2022, 1:14pm UTC](https://discuss.elastic.co/t/logstash-kafka-input-and-output-with-oauth/304886/2 "2022-05-17T13:14:05Z")

</div>

> [@Jockj](#):
>
> oauth2

Similar [answer](https://discuss.elastic.co/t/how-to-generate-oauth2-token-and-use-rest-api-to-pull-logs-from-cloud/166624/2).

---

<div class="post-metadata">

### Author: ![Jockj](https://avatars.discourse-cdn.com/v4/letter/j/3ec8ea/32.png) [@Jockj](https://discuss.elastic.co/u/Jockj)
#### Post date: [May 17, 2022, 10:00pm UTC](https://discuss.elastic.co/t/logstash-kafka-input-and-output-with-oauth/304886/3 "2022-05-17T22:00:45Z")

</div>

Thanks.  
the Kafka Java client did support callback to login the oauth, now the problem is that the thread is interrupted when it goes to sleep.

---

<div class="post-metadata">

### Author: ![Jockj](https://avatars.discourse-cdn.com/v4/letter/j/3ec8ea/32.png) [@Jockj](https://discuss.elastic.co/u/Jockj)
#### Post date: [May 17, 2022, 10:02pm UTC](https://discuss.elastic.co/t/logstash-kafka-input-and-output-with-oauth/304886/4 "2022-05-17T22:02:08Z")

</div>

I'm not sure which application/process/thread interrupt it, and how to avoid it.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [June 14, 2022, 10:02pm UTC](https://discuss.elastic.co/t/logstash-kafka-input-and-output-with-oauth/304886/5 "2022-06-14T22:02:37Z")

</div>

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