public static AccessTokenRetriever create(Map<String, ?> configs,
        String saslMechanism,
        Map<String, Object> jaasConfig) {
        ConfigurationUtils cu = new ConfigurationUtils(configs, saslMechanism);
        URL tokenEndpointUrl = cu.validateUrl(SASL_OAUTHBEARER_TOKEN_ENDPOINT_URL);

        if (tokenEndpointUrl.getProtocol().toLowerCase(Locale.ROOT).equals("file")) {
            return new FileTokenRetriever(cu.validateFile(SASL_OAUTHBEARER_TOKEN_ENDPOINT_URL));
        } else {
            JaasOptionsUtils jou = new JaasOptionsUtils(jaasConfig);
            String clientId = jou.validateString(CLIENT_ID_CONFIG);
            String clientSecret = jou.validateString(CLIENT_SECRET_CONFIG);
            String scope = jou.validateString(SCOPE_CONFIG, false);

            SSLSocketFactory sslSocketFactory = null;

            if (jou.shouldCreateSSLSocketFactory(tokenEndpointUrl))
                sslSocketFactory = jou.createSSLSocketFactory();

            return new HttpAccessTokenRetriever(clientId,
                clientSecret,
                scope,
                sslSocketFactory,
                tokenEndpointUrl.toString(),
                cu.validateLong(SASL_LOGIN_RETRY_BACKOFF_MS),
                cu.validateLong(SASL_LOGIN_RETRY_BACKOFF_MAX_MS),
                cu.validateInteger(SASL_LOGIN_CONNECT_TIMEOUT_MS, false),
                cu.validateInteger(SASL_LOGIN_READ_TIMEOUT_MS, false),
                cu.get(SASL_OAUTHBEARER_HEADER_URLENCODE));
        }
    }
Create an {@link AccessTokenRetriever} from the given SASL and JAAS configuration.

<b>Note</b>: the returned <code>AccessTokenRetriever</code> is <em>not</em> initialized
here and must be done by the caller prior to use.

@param configs    SASL configuration
@param jaasConfig JAAS configuration

@return Non-<code>null</code> {@link AccessTokenRetriever}
clients/src/main/java/org/apache/kafka/common/security/oauthbearer/internals/secured/AccessTokenRetrieverFactory.java