Search in sources :

Example 1 with OpenShiftOAuthInterceptor

use of io.fabric8.openshift.client.internal.OpenShiftOAuthInterceptor in project che-server by eclipse-che.

the class OpenShiftClientFactory method clientForConfig.

private OkHttpClient clientForConfig(Config config) {
    OkHttpClient clientHttpClient = getHttpClient().newBuilder().authenticator(Authenticator.NONE).build();
    OkHttpClient.Builder builder = clientHttpClient.newBuilder();
    builder.interceptors().clear();
    return builder.addInterceptor(new OpenShiftOAuthInterceptor(clientHttpClient, OpenShiftConfig.wrap(config))).addInterceptor(new ImpersonatorInterceptor(config)).build();
}
Also used : OkHttpClient(okhttp3.OkHttpClient) ImpersonatorInterceptor(io.fabric8.kubernetes.client.utils.ImpersonatorInterceptor) OpenShiftOAuthInterceptor(io.fabric8.openshift.client.internal.OpenShiftOAuthInterceptor)

Example 2 with OpenShiftOAuthInterceptor

use of io.fabric8.openshift.client.internal.OpenShiftOAuthInterceptor in project devspaces-images by redhat-developer.

the class OpenShiftClientFactory method clientForConfig.

private OkHttpClient clientForConfig(Config config) {
    OkHttpClient clientHttpClient = getHttpClient().newBuilder().authenticator(Authenticator.NONE).build();
    OkHttpClient.Builder builder = clientHttpClient.newBuilder();
    builder.interceptors().clear();
    return builder.addInterceptor(new OpenShiftOAuthInterceptor(clientHttpClient, OpenShiftConfig.wrap(config))).addInterceptor(new ImpersonatorInterceptor(config)).build();
}
Also used : OkHttpClient(okhttp3.OkHttpClient) ImpersonatorInterceptor(io.fabric8.kubernetes.client.utils.ImpersonatorInterceptor) OpenShiftOAuthInterceptor(io.fabric8.openshift.client.internal.OpenShiftOAuthInterceptor)

Aggregations

ImpersonatorInterceptor (io.fabric8.kubernetes.client.utils.ImpersonatorInterceptor)2 OpenShiftOAuthInterceptor (io.fabric8.openshift.client.internal.OpenShiftOAuthInterceptor)2 OkHttpClient (okhttp3.OkHttpClient)2