public void close() {
        if (refresherThread != null && refresherThread.isAlive()) {
            refresherThread.interrupt();
            try {
                refresherThread.join();
            } catch (InterruptedException e) {
                log.warn("[Principal={}]: Interrupted while waiting for re-login thread to shutdown.",
                        principalLogText(), e);
                Thread.currentThread().interrupt();
            }
        }
    }
Performs login for each login module specified for the login context of this
instance and starts the thread used to periodically re-login.
<p>
The synchronized keyword is not necessary because an implementation of
{@link Login} will delegate to this code (e.g. OAuthBearerRefreshingLogin),
and the {@code login()} method on the delegating class will itself be
synchronized if necessary.
clients/src/main/java/org/apache/kafka/common/security/oauthbearer/internals/expiring/ExpiringCredentialRefreshingLogin.java