public static JaasContext loadServerContext(ListenerName listenerName, String mechanism, Map<String, ?> configs) {
        if (listenerName == null)
            throw new IllegalArgumentException("listenerName should not be null for SERVER");
        if (mechanism == null)
            throw new IllegalArgumentException("mechanism should not be null for SERVER");
        String listenerContextName = listenerName.value().toLowerCase(Locale.ROOT) + "." + GLOBAL_CONTEXT_NAME_SERVER;
        Password dynamicJaasConfig = (Password) configs.get(mechanism.toLowerCase(Locale.ROOT) + "." + SaslConfigs.SASL_JAAS_CONFIG);
        if (dynamicJaasConfig == null && configs.get(SaslConfigs.SASL_JAAS_CONFIG) != null)
            LOG.warn("Server config {} should be prefixed with SASL mechanism name, ignoring config", SaslConfigs.SASL_JAAS_CONFIG);
        return load(Type.SERVER, listenerContextName, GLOBAL_CONTEXT_NAME_SERVER, dynamicJaasConfig);
    }
Returns an instance of this class.

The context will contain the configuration specified by the JAAS configuration property
{@link SaslConfigs#SASL_JAAS_CONFIG} with prefix `listener.name.{listenerName}.{mechanism}.`
with listenerName and mechanism in lower case. The context `KafkaServer` will be returned
with a single login context entry loaded from the property.
<p>
If the property is not defined, the context will contain the default Configuration and
the context name will be one of:
<ol>
  <li>Lowercased listener name followed by a period and the string `KafkaServer`</li>
  <li>The string `KafkaServer`</li>
 </ol>
If both are valid entries in the default JAAS configuration, the first option is chosen.
</p>

@throws IllegalArgumentException if listenerName or mechanism is not defined.
clients/src/main/java/org/apache/kafka/common/security/JaasContext.java