public LoginContext createLoginContext(ExpiringCredentialRefreshingLogin expiringCredentialRefreshingLogin)
                throws LoginException {
            return new LoginContext(expiringCredentialRefreshingLogin.contextName(),
                    expiringCredentialRefreshingLogin.subject(), expiringCredentialRefreshingLogin.callbackHandler(),
                    expiringCredentialRefreshingLogin.configuration());
        }
Class that can be overridden for testing
clients/src/main/java/org/apache/kafka/common/security/oauthbearer/internals/expiring/ExpiringCredentialRefreshingLogin.java