> For the complete documentation index, see [llms.txt](https://docs.sonarsource.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sonarsource.com/sonarqube-server/instance-administration/security/administering-tokens.md).

# Tokens

Generating and revoking user tokens in SonarQube Server 2026.5.

As a System Administrator, you can generate tokens of type **User** on behalf of another user and you can revoke any token. For more information about tokens and how to manage your own tokens, see [Managing your tokens](/sonarqube-server/user-guide/managing-tokens.md).

## Generating a token on behalf of another user <a href="#generating-user-token" id="generating-user-token"></a>

1. In **Administration** > **Security** > **Users**, retrieve the user (see [Viewing user accounts](/sonarqube-server/instance-administration/user-management/viewing-users.md)).
2. In the user’s **Tokens** column, select the three-dot menu. The **Tokens** dialog opens.
3. Enter the token name, check the expiration date, and select **Generate**.

## Revoking a token <a href="#revoking-token" id="revoking-token"></a>

1. In **Administration** > **Security** > **Users**, retrieve the user (see [Viewing user accounts](/sonarqube-server/instance-administration/user-management/viewing-users.md)).
2. In the user’s **Tokens** column, select the three-dot menu. The **Tokens** dialog opens with the list of tokens.
3. In the **Actions** column of the token, select **Revoke**.

## Enforcing a maximum lifetime for tokens (from Enterprise Edition) <a href="#enforcing-max-lifetime-for-tokens" id="enforcing-max-lifetime-for-tokens"></a>

The ability to configure a maximum lifetime for tokens is available starting in [Enterprise Edition](https://www.sonarsource.com/plans-and-pricing/enterprise/).

As a System Administrator, you can define a maximum lifetime for any *newly* generated token. Non-administrator users can also set a time-to-live as long as it is less than or equal to the maximum lifetime configured at the system level. Tokens generated after updating this setting will expire either at the configured maximum lifetime or at the time set by the user, whichever comes first.

{% hint style="info" %}
Updating this setting does *not* affect any existing tokens. It will only impact newly generated tokens.
{% endhint %}

To enforce a maximum lifetime for tokens at the system level:

1. Go to **Administration** > **Configuration** > **General settings** > **Security**.
2. In **Maximum allowed lifetime for token**, select the lifetime you want to set.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.sonarsource.com/sonarqube-server/instance-administration/security/administering-tokens.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
