For Kafka Server
*********SECURITY using OAUTHBEARER authentication ***************
sasl.enabled.mechanisms=OAUTHBEARER
sasl.mechanism.inter.broker.protocol=OAUTHBEARER
security.inter.broker.protocol=SASL_PLAINTEXT
listeners=SASL_PLAINTEXT://localhost:9093
advertised.listeners=SASL_PLAINTEXT://localhost:9093
*Authorizer for ACL
authorizer.class.name=kafka.security.auth.SimpleAclAuthorizer
super.users=User:0oalmwzen2tCuDytB05d7;
**************** OAuth Classes *********************
sasl.jaas.config=org.apache.kafka.common.security.oauthbearer.OAuthBearerLoginModule required OAUTH_LOGIN_SERVER=dev-someid.okta.com OAUTH_LOGIN_ENDPOINT='/oauth2/default/v1/token' OAUTH_LOGIN_GRANT_TYPE=client_credentials OAUTH_LOGIN_SCOPE=broker.kafka OAUTH_AUTHORIZATION='Basic AFSDFASFSAFWREWSFDSAFDSAFADSFDSFDASFWERWEGRDFASDFAFEWRSDFSDFW==' OAUTH_INTROSPECT_SERVER=dev-someid.okta.com OAUTH_INTROSPECT_ENDPOINT='/oauth2/default/v1/introspect' OAUTH_INTROSPECT_AUTHORIZATION='Basic AFSDFASFSAFWREWSFDSAFDSAFADSFDSFDASFWERWEGRDFASDFAFEWRSDFSDFW==';
listener.name.sasl_plaintext.oauthbearer.sasl.login.callback.handler.class=com.oauth2.security.oauthbearer.OAuthAuthenticateLoginCallbackHandler
listener.name.sasl_plaintext.oauthbearer.sasl.server.callback.handler.class=com.oauth2.security.oauthbearer.OAuthAuthenticateValidatorCallbackHandler
********** SECURITY using OAUTHBEARER authentication ***************
I followed this article https://medium.com/egen/how-to-configure-oauth2-authentication-for-apache-kafka-cluster-using-okta-8c60d4a85b43
Now the problem is I want to write a producer and consumer with Java-code which should be provider independent such as such as okta , keycloak ,IBM Security Access Manager (ISAM) Identity Provider.
How can I achieve that?