'Kerberos Authentication Windows | Confluent_kakfa python |Trying to connect by getting but getting Failed to initialize SASL authentication error

Kerberos Authentication Windows | Confluent_kakfa python |Trying to connect by getting but getting Failed to initialize SASL authentication error. I did some digging and it turns out that Windows uses logged in user's credentials. See the full error below

 Failed to initialize SASL authentication: InitializeSecurityContext failed: Target unknown (0x80090303) (after 2ms in state AUTH_REQ)"}

Any work-around so that we can use keytab here? If I'm not wrong, this is the correct approach, right?

producer config:-

    'bootstrap.servers': bootstrap_servers,
'client.id': socket.gethostname(),
'error_cb': error_cb,
'security.protocol': 'SASL_SSL',
'sasl.mechanisms': 'GSSAPI',
'sasl.kerberos.principal': '<principal;>',
# 'sasl.kerberos.keytab': 'svc_cmp_poc.keytab',
'sasl.kerberos.service.name': 'kafka',
# 'sasl.kerberos.kinit.cmd': 'kinit -k -t "%{sasl.kerberos.keytab}" %{sasl.kerberos.principal}',
'ssl.ca.location': 'svc_cmp_poc\certificate.pem'


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source