title: KafkaJaasLoginModuleInitializer caching the login configuration cause the issue
body: <p>KafkaJaasLoginModuleInitializer will set &amp; cache javax.security.auth.login.Configuration in org.springframework.kafka.security.jaas.KafkaJaasLoginModuleInitializer#afterSingletonsInstantiated by calling</p>
  <pre class="lang-java prettyprint-override"><code>Configuration.setConfiguration(new InternalConfiguration(configurationEntries));
  </code></pre>
  <p>the actual authN/connection will get the configuration by calling org.springframework.kafka.security.jaas.KafkaJaasLoginModuleInitializer.InternalConfiguration#getAppConfigurationEntry</p>
  <pre class="lang-java prettyprint-override"><code>        @Override
          public AppConfigurationEntry[] getAppConfigurationEntry(String name) {
              return this.configurationEntries.get(name);
          }
  </code></pre>
  <p>it works fine unless the application also connect to other system besides Kafka.</p>
  <p>In my case, the application connects to both Kafka &amp; Oracle with kerberos authentication supported by spring-kafka &amp; Oracle JDBC driver. JDBC driver has the similar logic to call javax.security.auth.login.Configuration#setConfiguration with Oracle specific configuration. It will depends on who start to do connection first. In my case, if calling Kafka first, then following Oracle, both connection will success; But calling oracle first, the subsequent Kafka call will failed, as the spring-kafka think nobody touch javax.security.auth.login.Configuration, the Kafka login configuration shall be there, but they had been overwritten by JDBC driver.</p>
  <p>my current work around:
  whenever to call Kafka, code has to call org.springframework.kafka.security.jaas.KafkaJaasLoginModuleInitializer#afterSingletonsInstantiated first, to make sure kafka Kerberos info there. As it will call the below method in Configuration</p>
  <pre class="lang-java prettyprint-override"><code>  public static void setConfiguration(Configuration configuration) {
          SecurityManager sm = System.getSecurityManager();
          if (sm != null)
              sm.checkPermission(new AuthPermission(&quot;setLoginConfiguration&quot;));
          Configuration.configuration = configuration;
      }
  </code></pre>
  <p>And JDBC driver also call the same static method, it seems not thread safe also.</p>
  <p>what would be the correct approach to solve the issue?</p>
  <p>adding more stack trace:</p>
  <pre><code>2021-04-02T16:10:41.652-04:00 [APP/PROC/WEB/0] [ERR] Caused by: java.lang.IllegalArgumentException: Could not find a 'KafkaClient' entry in the JAAS configuration. System property 'java.security.auth.login.config' is /home/vcap/tmp/kafka-client-jaas-config-placeholder200676903256133280conf
  2021-04-02T16:10:41.652-04:00 [APP/PROC/WEB/0] [ERR] at org.apache.kafka.common.security.JaasContext.defaultContext(JaasContext.java:133)
  2021-04-02T16:10:41.652-04:00 [APP/PROC/WEB/0] [ERR] at org.apache.kafka.common.security.JaasContext.load(JaasContext.java:98)
  2021-04-02T16:10:41.652-04:00 [APP/PROC/WEB/0] [ERR] at org.apache.kafka.common.security.JaasContext.loadClientContext(JaasContext.java:84)
  2021-04-02T16:10:41.652-04:00 [APP/PROC/WEB/0] [ERR] at org.apache.kafka.common.network.ChannelBuilders.create(ChannelBuilders.java:124)
  2021-04-02T16:10:41.652-04:00 [APP/PROC/WEB/0] [ERR] at org.apache.kafka.common.network.ChannelBuilders.clientChannelBuilder(ChannelBuilders.java:67)
  2021-04-02T16:10:41.652-04:00 [APP/PROC/WEB/0] [ERR] at org.apache.kafka.clients.ClientUtils.createChannelBuilder(ClientUtils.java:99)
  2021-04-02T16:10:41.652-04:00 [APP/PROC/WEB/0] [ERR] at org.apache.kafka.clients.producer.KafkaProducer.newSender(KafkaProducer.java:441)
  2021-04-02T16:10:41.652-04:00 [APP/PROC/WEB/0] [ERR] at org.apache.kafka.clients.producer.KafkaProducer.&lt;init&gt;(KafkaProducer.java:422)
  
  </code></pre>