简体   繁体   English

如何在kafka中实现OAUTHBEARER SASL认证机制?

[英]How to implement OAUTHBEARER SASL authentication mechanism in kafka?

任何人都可以解释客户端或代理间通信如何使用 kafka 中的 OAUTHBEARER 身份验证机制进行?

You will need to implement two classes that uses an interface called AuthenticateCallbackHandler .您将需要实现两个使用名为AuthenticateCallbackHandler的接口的类。

The first class implements the Login flow, where you need to call your OAuth server to retrieve a token.第一个类实现登录流程,您需要在其中调用 OAuth 服务器来检索令牌。 This class will be used by your clients or for interbroker connection.此类将由您的客户端使用或用于代理间连接。

The second class implements the Validation flow, where you will call your OAuth server to check if the send token is valid.第二个类实现验证流程,您将在其中调用您的 OAuth 服务器来检查发送令牌是否有效。 This class will be used only at Kafka Broker.此类将仅在 Kafka Broker 中使用。

I have an example of this implementation at github.com/jairsjunior/kafka-oauth我在github.com/jairsjunior/kafka-oauth有一个这个实现的例子

If you want to see how to setup a Kafka broker using this SASL mechanism, there is an article with all steps.如果您想了解如何使用这种 SASL 机制设置 Kafka 代理,请参阅包含所有步骤的文章。 https://medium.com/@jairsjunior/how-to-setup-oauth2-mechanism-to-a-kafka-broker-e42e72839fe https://medium.com/@jairsjunior/how-to-setup-oauth2-mechanism-to-a-kafka-broker-e42e72839fe

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM