<p>I am trying using Kubernetes Java client for few use cases.</p>
<p><a href="https://github.com/kubernetes-client/java" rel="nofollow noreferrer">https://github.com/kubernetes-client/java</a></p>
<p>Our Kubernetes cluster is been implemented with OpenId authentication.</p>
<p>Unfortunately, the Java client doesn't support OpenId auth.</p>
<p><strong>Java code:</strong></p>
<pre><code>final ApiClient client = io.kubernetes.client.util.Config.defaultClient();
        Configuration.setDefaultApiClient(client);
        
        CoreV1Api api = new CoreV1Api();
        V1PodList list = api.listPodForAllNamespaces(null, null, null, null, null, null, null, null, null);
        for (V1Pod item : list.getItems()) {
            System.out.println(item.getMetadata().getName());
        }
</code></pre>
<p><strong>Error:</strong></p>
<pre><code>13:25:22.549 [main] ERROR io.kubernetes.client.util.KubeConfig - Unknown auth provider: oidc
Exception in thread &quot;main&quot; io.kubernetes.client.ApiException: Forbidden
    at io.kubernetes.client.ApiClient.handleResponse(ApiClient.java:882)
    at io.kubernetes.client.ApiClient.execute(ApiClient.java:798)
    at io.kubernetes.client.apis.CoreV1Api.listPodForAllNamespacesWithHttpInfo(CoreV1Api.java:18462)
    at io.kubernetes.client.apis.CoreV1Api.listPodForAllNamespaces(CoreV1Api.java:18440)
</code></pre>
<p>Is there any plan to support OpenId auth with the Java client. Or, is there any other way?</p>

<p><a href="https://github.com/kubernetes-client/java/tree/client-java-parent-2.0.0-beta1/util/src/main/java/io/kubernetes/client/util/credentials" rel="nofollow noreferrer">Apparently not</a>, but by far the larger question is: what would you <em>expect</em> to happen with an <code>oidc</code> <code>auth-provider</code> in a Java setting? Just use the <code>id-token</code>? Be able to use the <code>refresh-token</code> and throw an exception if unable to reacquire an <code>id-token</code>? Some callback system for you to manage that lifecycle on your own?</p>

<p>Trying to do oidc from a <em>library</em> is fraught with peril, since it is almost certain that there is no "user" to interact with.</p>

<blockquote>
  <p>Is there any plan to support OpenId auth with the Java client</p>
</blockquote>

<p>Only the project maintainers could answer that, and it is unlikely they know to prioritize that kind of work when there is no issue describing what you would expect to happen. Feel free to <a href="https://github.com/kubernetes-client/java/issues" rel="nofollow noreferrer">create one</a>.</p>

<blockquote>
  <p>Or, is there any other way?</p>
</blockquote>

<p>In the meantime, you still have <a href="https://github.com/kubernetes-client/java/blob/client-java-parent-2.0.0-beta1/util/src/main/java/io/kubernetes/client/util/Config.java#L63" rel="nofollow noreferrer"><code>Config.fromToken()</code></a> where you can go fishing in your <code>.kube/config</code> and pull out the existing <code>id-token</code> then deal with any subsequent <code>ApiException</code> which requires using the <code>refresh-token</code>, because you will know more about what tradeoffs your client is willing to make.</p>
