// Module included in the following assemblies:
//
// assembly-configuring-kafka-listeners.adoc

[id='proc-kafka-authentication-{context}']
= Configuring authentication in Kafka brokers

.Prerequisites

* An {ProductPlatformName} cluster
* A running Cluster Operator

.Procedure

. Edit the `listeners` property in the `Kafka.spec.kafka` resource.
Add the `authentication` field to the listeners where you want to enable authentication.
For example:
+
[source,yaml,subs=attributes+]
----
apiVersion: {KafkaApiVersion}
kind: Kafka
spec:
  kafka:
    # ...
    listeners:
      tls:
        authentication:
          type: tls
    # ...
  zookeeper:
    # ...
----

. Create or update the resource.
+
ifdef::Kubernetes[]
On {KubernetesName} this can be done using `kubectl apply`:
[source,shell,subs=+quotes]
kubectl apply -f _your-file_
+
endif::Kubernetes[]
On {OpenShiftName} this can be done using `oc apply`:
+
[source,shell,subs=+quotes]
oc apply -f _your-file_

.Additional resources
* For more information about the supported authentication mechanisms, see xref:ref-kafka-authentication-{context}[authentication reference].
* For more information about the schema for `Kafka`, see xref:type-Kafka-reference[`Kafka` schema reference].
