private LoginModuleControlFlag loginModuleControlFlag(String flag) {
        if (flag == null)
            throw new IllegalArgumentException("Login module control flag is not available in the JAAS config");

        LoginModuleControlFlag controlFlag;
        switch (flag.toUpperCase(Locale.ROOT)) {
            case "REQUIRED":
                controlFlag = LoginModuleControlFlag.REQUIRED;
                break;
            case "REQUISITE":
                controlFlag = LoginModuleControlFlag.REQUISITE;
                break;
            case "SUFFICIENT":
                controlFlag = LoginModuleControlFlag.SUFFICIENT;
                break;
            case "OPTIONAL":
                controlFlag = LoginModuleControlFlag.OPTIONAL;
                break;
            default:
                throw new IllegalArgumentException("Invalid login module control flag '" + flag + "' in JAAS config");
        }
        return controlFlag;
    }
JAAS configuration parser that constructs a JAAS configuration object with a single
login context from the Kafka configuration option {@link SaslConfigs#SASL_JAAS_CONFIG}.
<p/>
JAAS configuration file format is described <a href="http://docs.oracle.com/javase/8/docs/technotes/guides/security/jgss/tutorials/LoginConfigFile.html">here</a>.
The format of the property value is:
<pre>
{@code
  <loginModuleClass> <controlFlag> (<optionName>=<optionValue>)*;
}
</pre>
clients/src/main/java/org/apache/kafka/common/security/JaasConfig.java