--- title: Tokens ---
## Token Resource Rancher has an imperative API resource `tokens.ext.cattle.io` that allows you to generate tokens for authenticating with Rancher. ```sh kubectl api-resources --api-group=ext.cattle.io ``` To get a description of the fields and structure of the Token resource, run: ```sh kubectl explain tokens.ext.cattle.io ``` ## Feature Flag The Tokens Public API is available for Rancher v2.12.0 and later, and is enabled by default. You can disable the Tokens Public API by setting the `ext-tokens` feature flag to `false` as shown in the example `kubectl` command below: ```sh kubectl patch feature ext-tokens -p '{"spec":{"value":false}}' ``` ## Creating a Token :::caution The Token value is only returned once in the `status.value` field. ::: Only a **valid and active** Rancher user can create a Token. Otherwise, you will get an error displayed (`Error from server (Forbidden)...`) when attempting to create a Token. ```bash kubectl create -o jsonpath='{.status.value}' -f -<