Hi Michael, Indeed the Opensearch REST client supports only basic auth at the moment. I don't know which sink are you using, but the streaming/connectors/opensearch/OpensearchSink provides the capability to configure the underlying client using RestClientFactory [1] so you could add the request / response interceptors to propagate OAuth2 tokens etc. This is not possible with other sinks yet but I think it should not be difficult to implement. If this is the case for you, could you please open the JIRA ticket?
Thank you. [1] https://github.com/apache/flink-connector-opensearch/blob/main/flink-connector-opensearch/src/main/java/org/apache/flink/streaming/connectors/opensearch/RestClientFactory.java Best Regards, Andriy Redko Tuesday, April 18, 2023, 3:47:22 AM, you wrote: > Hi Michael, > I'm looping in Andrey since he has worked a lot on the Opensearch connector. > A contribution is very welcome in case this can be improved. > Best regards, > Martijn > On Tue, Apr 18, 2023 at 8:45 AM Michael Hempel Jørgensen <m...@trifork.com> > wrote: >> Hi, >> we need to use OAuth2 (Client Credentials Flow) in Flink to authenticate and >> authorise against different services, initially Kafka and Opensearch. We >> have it working with Kafka using however it doesn't seem to be possible with >> the Opensearch Flink Connector >> (https://github.com/apache/flink-connector-opensearch). >> It looks like the connector only supports basic auth (user/pass) at the >> moment, and doesn't have an option for manually setting custom headers >> either. Is this correct? >> Is there any work in progress towards making this possible? >> We are willing to help contribute to code/discussions if necessary to get >> this implemented somehow. >> Regards, >> Michael