Authentication error while using SCRAM

HI, I am trying to configure SCRAM for authentication for the cluster and topic created in Confluent Cloud. but always getting the error. I created the Kafka cluster and topic after logging into Confluent Cloud. Where i can enable these settings?

org.apache.kafka.common.errors.UnsupportedSaslMechanismException: Client SASL mechanism 'SCRAM-SHA-256' not enabled in the server, enabled mechanisms are [PLAIN, OAUTHBEARER]

Here is my config file entry. I am using the. java program given on Confluent site.

bootstrap.servers=p3ee111-mykafka.eastus2.azure.confluent.cloud:9092
security.protocol=SASL_SSL
sasl.jaas.config=org.apache.kafka.common.security.scram.ScramLoginModule  required username='xxxxxx'  password='secretly';

sasl.mechanism=SCRAM-SHA-256
# Required for correctness in Apache Kafka clients prior to 2.6
client.dns.lookup=use_all_dns_ips

# Best practice for higher availability in Apache Kafka clients prior to 3.0
session.timeout.ms=45000

# Best practice for Kafka producer to prevent data loss
acks=all

# Required connection configs for Confluent Cloud Schema Registry
schema.registry.url=https://{{ SR_ENDPOINT }}
basic.auth.credentials.source=USER_INFO
basic.auth.user.info={{ SR_API_KEY }}:{{ SR_API_SECRET }}
sasl.enabled.mechanisms=SCRAM-SHA-256
sasl.mechanism.inter.broker.protocol=SCRAM-SHA-256
security.inter.broker.protocol=SASL_SSL
listeners=SASL_SSL://p3ee111. mykafka.eastus2.azure.confluent.cloud:9092
listener.name.sasl_ssl.scram-sha-256.sasl.jaas.config=org.apache.kafka.common.security.scram.ScramLoginModule required username='xxxxxx' password='xxxxxx';

(edited

Hi @rishisoft1

afaik and according to the following example sasl.mechanism needs to be set to plain

props.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, "<CCLOUD_BOOTSTRAP_SERVER>");
props.put(ProducerConfig.REPLICATION_FACTOR_CONFIG, 3);
props.put(ProducerConfig.SECURITY_PROTOCOL_CONFIG, "SASL_SSL");
props.put(SaslConfigs.SASL_MECHANISM, "PLAIN");
props.put(SaslConfigs.SASL_JAAS_CONFIG, "org.apache.kafka.common.security.plain.PlainLoginModule required username='<CCLOUD_API_KEY>' password='<CCLOUD_API_SECRET>';");

full example here:

best,
michael