<p>I'm running an eks cluster, installed k8s dashboard etc. All works fine, I can login in the UI in</p>
<pre><code>http://localhost:8001/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:/proxy/#/login
</code></pre>
<p>Is there a way for me to pass the token via the url so I won't need a human to do this?
Thanks!</p>

J. Doe
<p>Based on <a href="https://github.com/kubernetes/dashboard/blob/v2.0.0/docs/user/access-control/README.md#access-control" rel="nofollow noreferrer">official documentation</a> it is impossible to put your authentication token in URL.</p>
<blockquote>
<p>As of release 1.7 Dashboard supports user authentication based on:</p>
<ul>
<li><a href="https://github.com/kubernetes/dashboard/blob/v2.0.0/docs/user/access-control/README.md#authorization-header" rel="nofollow noreferrer"><code>Authorization: Bearer &lt;token&gt;</code></a>  header passed in every request to Dashboard. Supported from release 1.6. Has the highest priority. If present, login view will not be shown.</li>
<li><a href="https://github.com/kubernetes/dashboard/blob/v2.0.0/docs/user/access-control/README.md#bearer-token" rel="nofollow noreferrer">Bearer Token</a>  that can be used on Dashboard  <a href="https://github.com/kubernetes/dashboard/blob/v2.0.0/docs/user/access-control/README.md#login-view" rel="nofollow noreferrer">login view</a>.</li>
<li><a href="https://github.com/kubernetes/dashboard/blob/v2.0.0/docs/user/access-control/README.md#basic" rel="nofollow noreferrer">Username/password</a>  that can be used on Dashboard  <a href="https://github.com/kubernetes/dashboard/blob/v2.0.0/docs/user/access-control/README.md#login-view" rel="nofollow noreferrer">login view</a>.</li>
<li><a href="https://github.com/kubernetes/dashboard/blob/v2.0.0/docs/user/access-control/README.md#kubeconfig" rel="nofollow noreferrer">Kubeconfig</a>  file that can be used on Dashboard  <a href="https://github.com/kubernetes/dashboard/blob/v2.0.0/docs/user/access-control/README.md#login-view" rel="nofollow noreferrer">login view</a>.</li>
</ul>
</blockquote>
<p>As you can see, only the first option bypasses the Dashboard login view. So, what is Bearer Authentication?</p>
<blockquote>
<p><strong>Bearer authentication</strong> (also called <strong>token authentication</strong>) is an <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication" rel="nofollow noreferrer">HTTP authentication scheme</a> that involves security tokens called bearer tokens. The name “Bearer authentication” can be understood as “give access to the bearer of this token.” The bearer token is a cryptic string, usually generated by the server in response to a login request. The client must send this token in the <code>Authorization</code> header when making requests to protected resources:</p>
</blockquote>
<p>You can find more information about Baerer Authentication <a href="https://swagger.io/docs/specification/authentication/bearer-authentication/" rel="nofollow noreferrer">here</a>.</p>
<p>The question now is how you can include the authentication header in your request. There are many ways to achieve this:</p>
<ul>
<li><code>curl</code> command - example:</li>
</ul>
<pre><code>curl -H &quot;Authorization: Bearer &lt;TOKEN_VALUE&gt;&quot; &lt;https://address-your-dashboard&gt;
</code></pre>
<ul>
<li>Postman application - <a href="https://stackoverflow.com/questions/40539609/how-to-add-authorization-header-in-postman-environment">here</a> is good answer to set up authorization header with screenshots.</li>
<li>reverse proxy - you can be achieve this i.e. by configuring reverse proxy in front of Dashboard. Proxy will be responsible for authentication with identity provider and will pass generated token in request header to Dashboard. Note that Kubernetes API server needs to be configured properly to accept these tokens. You can read more about it <a href="https://github.com/kubernetes/dashboard/blob/master/docs/user/access-control/README.md#authorization-header" rel="nofollow noreferrer">here</a>. You should know, that this method is potentially insecure due to <a href="https://en.wikipedia.org/wiki/Man-in-the-middle_attack" rel="nofollow noreferrer">Man In The Middle Attack</a> when you are using http.</li>
</ul>
<p>You can also read very good answers to the question <a href="https://stackoverflow.com/questions/46664104/how-to-sign-in-kubernetes-dashboard">how to sign in kubernetes dashboard</a>.</p>
