Closed davidmontgom closed 3 years ago
You are using both c.Events() and c.Poll(), they're reading off the same channel, so you will need to choose one.
As shown in your output:
Ignored OAuthBearerTokenRefresh
The c.Poll() gets the TokenRefresh event but ignores it.
I suggest you add a case kafka.OAuthBearerTokenRefresh
to your c.Poll() loop.
I added the below:= and took out the events. I am now able to see that tokens were called. '
case kafka.OAuthBearerTokenRefresh:
oart, ok := ev.(kafka.OAuthBearerTokenRefresh)
fmt.Println("wow", oart)
if !ok {
// Ignore other event types
continue
}
handleOAuthBearerTokenRefreshEvent(c, oart)
Can I use SASL_SSL for "security.protocol" like my python code that works? I am using SASL_SSL with group.id 0
I now get the below error:
FindCoordinator response error: Group authorization failed.
% Error: Broker: Group authorization failed: FindCoordinator response error: Group authorization failed.
Simultaneously my python code is working.
I assume this is correct? handleOAuthBearerTokenRefreshEvent(c, oart)
Thanks for help!!!!!!!!
If you get "Group authorization failed" it means your client was able to connect and authenticate to the cluster, but ACLs are limiting the access to groups. Authentication vs authorization.
https://docs.confluent.io/platform/current/kafka/authorization.html
Could it be Principal: "principal=dude"? I did not have to supply with python. If not principal=dude ten what option on the config am I missng?
The only differene between python and confluent now apears to be this in python:
def create_ssl_context():
_ssl_context = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
_ssl_context.options |= ssl.OP_NO_SSLv2
_ssl_context.options |= ssl.OP_NO_SSLv3
_ssl_context.verify_mode = ssl.CERT_NONE
_ssl_context.check_hostname = False
_ssl_context.load_default_certs()
return _ssl_context
consumer = KafkaConsumer(
group_id=None,
bootstrap_servers=['test:9094'],
security_protocol='SASL_SSL',
sasl_mechanism='OAUTHBEARER',
sasl_oauth_token_provider=TokenProvider(client_id,client_secret), # returns a JWT
ssl_check_hostname=False,
ssl_context=create_ssl_context(),
auto_offset_reset=offset,
enable_auto_commit=False,
value_deserializer=decode_topic
)
consumer.subscribe(topics=topic_list)
Your user is not authorized to access the groups, check your ACLs.
Hi,
python kafka works with oauthbaerer confluent for python does not support oauthbearer Go I guess does but there are no clear examples on how to consume
Below is my code. I get no errors but I get no streams while python streams away.
So why will the go client not work with oauth?
Only output is below
Created Consumer rdkafka#consumer-1 Ignored OAuthBearerTokenRefresh
In python I connect thiks the below: