<p>I've installed kubectl (version 1.16.0) on Windows 10, and the command works fine.</p>

<p>However, when tryin to run <code>kubectl config set-credentials &lt;some_param&gt; --auth-provider=oidc</code>, I get the following error: <code>Error: unknown flag: --auth-provider</code>.</p>

<p>This happens even though when I run <code>kubectl config set-credentials -h</code> I can see the <code>--auth-provider</code> as a possible option..</p>

<p>How can it be fixed?</p>

ChikChak
<p>If you want to use the kubectl <a href="https://openid.net/connect/" rel="nofollow noreferrer">oidc</a> authenticator during authentication process, which sets the id_token as a bearer token for all requests and refreshes the token once it expires. After you’ve logged into your provider, use kubectl to add your id_token, refresh_token, client_id, and client_secret to configure the plugin.</p>

<p>Proper configuration of command <code>kubectl config set-credentials</code> is that:</p>

<p>First you have to define user name for whom credentials will be created. Then you can pass additional parameters (enable oidc as auth-provider and add arguments to it). This is how proper syntax of <code>kubectl config set-credentials</code> command should look like:</p>

<pre><code>   $ kubectl config set-credentials USER_NAME \
       --auth-provider=oidc \
       --auth-provider-arg=idp-issuer-url=( issuer url ) \
       --auth-provider-arg=client-id=( your client id ) \
       --auth-provider-arg=client-secret=( your client secret ) \
       --auth-provider-arg=refresh-token=( your refresh token ) \
       --auth-provider-arg=idp-certificate-authority=( path to your ca certificate ) \
       --auth-provider-arg=id-token=( your id_token )
</code></pre>

<p>More information about authentication you can find here: <a href="https://kubernetes.io/docs/reference/access-authn-authz/authentication/" rel="nofollow noreferrer">kubernetes-authentication</a>.</p>
