private SaslExtensions retrieveCustomExtensions() throws SaslException {
        SaslExtensionsCallback extensionsCallback = new SaslExtensionsCallback();
        try {
            callbackHandler().handle(new Callback[] {extensionsCallback});
        } catch (UnsupportedCallbackException e) {
            log.debug("Extensions callback is not supported by client callback handler {}, no extensions will be added",
                    callbackHandler());
        } catch (Exception e) {
            throw new SaslException("SASL extensions could not be obtained", e);
        }

        return extensionsCallback.extensions();
    }
{@code SaslClient} implementation for SASL/OAUTHBEARER in Kafka. This
implementation requires an instance of {@code AuthenticateCallbackHandler}
that can handle an instance of {@link OAuthBearerTokenCallback} and return
the {@link OAuthBearerToken} generated by the {@code login()} event on the
{@code LoginContext}. Said handler can also optionally handle an instance of {@link SaslExtensionsCallback}
to return any extensions generated by the {@code login()} event on the {@code LoginContext}.

@see <a href="https://tools.ietf.org/html/rfc6750#section-2.1">RFC 6750,
     Section 2.1</a>
clients/src/main/java/org/apache/kafka/common/security/oauthbearer/internals/OAuthBearerSaslClient.java