Issue while generating token

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.

Found any fix? I have the same issue.

kubectl -n kubernetes-dashboard create token admin-user

This command will generate a token for admin-user.


Thanks AkiJoey. This worked for me.!