<p>I have Kubernetes with ClusterRoles defined for my users and permissions by (RoleBindings) namespaces.
I want these users could be accessed into the Kubernetes Dashboard with custom perms. However, when they try to log in when using kubeconfig option that's got this message:</p>
<pre><code>&quot;Internal error (500): Not enough data to create auth info structure.&quot; 
</code></pre>
<p><a href="https://github.com/kubernetes/dashboard/blob/master/docs/user/access-control/creating-sample-user.md" rel="nofollow noreferrer">https://github.com/kubernetes/dashboard/blob/master/docs/user/access-control/creating-sample-user.md</a> -- This guide is only for creating ADMIN users, not users with custom perms or without privileges... (edited)</p>

<p><strong>Update SOLVED:</strong></p>
<p>You have to do this:</p>
<ol>
<li>Create ServiceAccount per user</li>
</ol>
<pre><code>apiVersion: v1
kind: ServiceAccount
metadata:
  name: NAME-user
  namespace: kubernetes-dashboard
</code></pre>
<ol start="2">
<li>Adapt the RoleBinding adding this SA</li>
</ol>
<pre><code>kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: PUT YOUR CR HERE
  namespace: PUT YOUR NS HERE
subjects:
  - kind: User
    name: PUT YOUR CR HERE
    apiGroup: 'rbac.authorization.k8s.io'
  - kind: ServiceAccount
    name: NAME-user
    namespace: kubernetes-dashboard
roleRef:
  kind: ClusterRole
  name: PUT YOUR CR HERE
  apiGroup: 'rbac.authorization.k8s.io'
</code></pre>
<ol start="3">
<li>Get the token:</li>
</ol>
<pre><code>kubectl -n kubernetes-dashboard get secret $(kubectl -n kubernetes-dashboard get sa/NAME-user -o jsonpath=&quot;{.secrets[0].name}&quot;) -o go-template=&quot;{{.data.token | base64decode}}&quot;

</code></pre>
<ol start="4">
<li>Add token into your kubeconfig file. Your kb should be contain something like this:</li>
</ol>
<pre><code>apiVersion: v1
clusters:
- cluster:
    server: https://XXXX
  name: kubernetes
contexts:
- context:
    cluster: kubernetes
    user: YOUR UER
  name: kubernetes
current-context: &quot;kubernetes&quot;
kind: Config
preferences: {}
users:
- name: YOUR USER
  user:
    client-certificate-data: CODED
    client-key-data: CODED
    token: CODED  ---&gt; ADD TOKEN HERE
</code></pre>
<ol start="5">
<li>Login</li>
</ol>
