All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.microsoft.azure.kusto.data.auth.AsyncCallbackTokenProvider Maven / Gradle / Ivy

There is a newer version: 5.2.0
Show newest version
package com.microsoft.azure.kusto.data.auth;

import com.microsoft.azure.kusto.data.exceptions.DataClientException;
import org.jetbrains.annotations.NotNull;
import reactor.core.publisher.Mono;

import java.net.URISyntaxException;

public class AsyncCallbackTokenProvider extends TokenProviderBase {
    public static final String CALLBACK_TOKEN_PROVIDER = "CallbackTokenProvider";
    private final Mono tokenProvider;

    AsyncCallbackTokenProvider(@NotNull String clusterUrl, @NotNull Mono tokenProvider) throws URISyntaxException {
        super(clusterUrl, null);
        this.tokenProvider = tokenProvider;
    }

    @Override
    protected Mono acquireAccessTokenImpl() {
        return tokenProvider.onErrorMap(e -> DataClientException.unwrapThrowable(clusterUrl, e));
    }

    @Override
    protected String getAuthMethod() {
        return CALLBACK_TOKEN_PROVIDER;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy