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.
security.protocol=SASL_SSL  required username='xxxxxx'  password='secretly';

# Required for correctness in Apache Kafka clients prior to 2.6

# Best practice for higher availability in Apache Kafka clients prior to 3.0

# Best practice for Kafka producer to prevent data loss

# Required connection configs for Confluent Cloud Schema Registry
schema.registry.url=https://{{ SR_ENDPOINT }}
basic.auth.credentials.source=USER_INFO{{ SR_API_KEY }}:{{ SR_API_SECRET }}
listeners=SASL_SSL://p3ee111. required username='xxxxxx' password='xxxxxx';


Hi @rishisoft1

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

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, " required username='<CCLOUD_API_KEY>' password='<CCLOUD_API_SECRET>';");

full example here: