# Issue while generating token

**URL:** <https://discuss.kubernetes.io/t/issue-while-generating-token/20039>\
**Category:** Windows\
**Tags:** development\
**Created:** [May 17, 2022, 3:55am UTC](https://discuss.kubernetes.io/t/issue-while-generating-token/20039 "2022-05-17T03:55:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![varmaranjith](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/varmaranjith/32/10085_2.png) [@varmaranjith](https://discuss.kubernetes.io/u/varmaranjith)\
**Post date:** [May 17, 2022, 3:55am UTC](https://discuss.kubernetes.io/t/issue-while-generating-token/20039/1 "2022-05-17T03:55:06Z")

</div>

Hi ,  
I have an issue while creating a kubernetes dashboard. I ran the commands as per the documentation, and while creating the Authentication token, with the command  
kubectl -n kubernetes-dashboard get secret $(kubectl -n kubernetes-dashboard get sa/admin-user -o jsonpath="{.secrets[0].name}") -o go-template="{{.data.token | base64decode}}"  
it gives me an error :error: error executing template “{{.data.token | base64decode}}”: template: output:1:16: executing “output” at : invalid value; expected string" can anyone help me with this. I was able to create admin-user and cluster role binding was also done.  
Any help is much appreciated.

---

<div class="post-metadata">

**Author:** ![Rareshh](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/rareshh/32/9621_2.png) [@Rareshh](https://discuss.kubernetes.io/u/Rareshh)\
**Post date:** [May 20, 2022, 12:11pm UTC](https://discuss.kubernetes.io/t/issue-while-generating-token/20039/2 "2022-05-20T12:11:15Z")

</div>

Found any fix? I have the same issue.

---

<div class="post-metadata">

**Author:** ![AkiJoey](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/akijoey/32/10126_2.png) [@AkiJoey](https://discuss.kubernetes.io/u/AkiJoey)\
**Post date:** [May 21, 2022, 7:35pm UTC](https://discuss.kubernetes.io/t/issue-while-generating-token/20039/3 "2022-05-21T19:35:55Z")

</div>

```auto
kubectl -n kubernetes-dashboard create token admin-user

```

This command will generate a token for `admin-user`.

---

<div class="post-metadata">

**Author:** ![varmaranjith](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/varmaranjith/32/10085_2.png) [@varmaranjith](https://discuss.kubernetes.io/u/varmaranjith)\
**Post date:** [May 23, 2022, 5:35am UTC](https://discuss.kubernetes.io/t/issue-while-generating-token/20039/4 "2022-05-23T05:35:35Z")

</div>

Thanks AkiJoey. This worked for me.!
