How to use the SASL/OAUTHBEARER mechanism in my client code?

Solution Verified - Updated -

Issue

My code always report:

Caused by: javax.security.auth.login.LoginException: io.strimzi.kafka.oauth.common.HttpException: POST request to https://identity.api.openshift.com/auth/realms/rhoas/protocol/openid-connect/token failed with status 400: {"error":"unauthorized_client","error_description":"INVALID_CREDENTIALS: Invalid client credentials"}

I want to use the SASL/OAUTHBEARER mechanism in my kafka client code, please tell the way and give the sample code.

Environment

  • Red Hat OpenShift Streams for Apache Kafka

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content