Blizzard / node-rdkafka

Node.js bindings for librdkafka
MIT License
2.08k stars 391 forks source link

Add setToken API for OAuthBearer authentication flow #1075

Closed andrewstanovsky closed 3 months ago

andrewstanovsky commented 3 months ago

This change adds new setToken API based on librdkafka's one to allow node-rdkafka clients authenticate using OAuthBearer flow. SetToken accepts token string only, no expiry is expected as it's always set to maximum value with librdkafka at C++ level. The client code is supposed to call setToken again to refresh a token when needed. The expiry is used in refresh callback flow of librdkafka which is not used in this change to avoid complexity.