从Spring Boot应用程序连接安全的kafka主题

时间:2019-07-04 09:01:25

标签: spring spring-boot weblogic

无法从运行在 WebLogic 中的 Spring Boot 应用程序连接安全的 Kafka 主题。

实际上问题是无法在连接krebors的同时加载KeyTab文件

我尝试过将Keytab文件放置在.war文件中以及服务器位置和etc文件夹下的文件之类的方法

String jaasConfig =  "com.sun.security.auth.module.Krb5LoginModule required useKeyTab= "+true+" doNotPrompt= "+false+" useTicketCache= "+false+" serviceName= "+"\""+"vod-kafka"+"\""+"storeKey= "+true+" refreshKrb5Config= "+true+" debug= "+true+" keyTab="+ "\""+absolute+"\""+" principal="+"\""+"svc-bd-sdpposmc-dev@DEVHADOOP.CHARTER.COM"+"\""+" client= "+true+";";
        properties.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG,serverIp);
        properties.put(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, "earliest");
        properties.put(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class);
        properties.put(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class);




        properties.put(SaslConfigs.SASL_MECHANISM,"PLAIN");
        properties.put(SaslConfigs.SASL_KERBEROS_SERVICE_NAME,"vod-kafka");
        properties.put(CommonClientConfigs.SECURITY_PROTOCOL_CONFIG,"SASL_SSL");

Debug是true storeKey是useTicketCache是false useKeyTab是doNotPrompt是false ticketCache是​​null isInitiator是KeyTab是

/charter/apps/osm/Oracle/Middleware/Oracle_Home/user_projects/domains/
base_domain/servers/OsmAdmin/tmp/_WL_user/
Complete-Order-Notification_19.3.0/qzbude/war/XXX 

refreshKrb5Config是true主体是XXX tryFirstPass是false useFirstPass是false storePass是false clearPass是false 刷新Kerberos配置

0 个答案:

没有答案