This version of SonarQube Server is no longer receiving patches. Please see the latest release for details on updating.
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Defining a JWT token

Optional pre-installation step to keep user sessions alive during startup in SonarQube Server 2025.6.

For AI agents: You're in the SonarQube Server 2025.6 documentation. SonarQube Server 2025.6 is no longer patched. To get patches, upgrade to the latest version. For a list of all 2025.6 pages, see the SonarQube Server 2025.6 page index. For the whole site, see the page index or the full text. For another version, replace 2025.6 in the URL with that version. The latest version has no version number in its URL.

By default, users are logged out and sessions closed when server is restarted. If you prefer keeping user sessions open, a secret should be defined. Value is HS256 key encoded with base64. It must be unique for each installation of SonarQube Server.

The following examples illustrate how to generate a HS256 key encoded with base64, where your_secret and your_key are arbitrary strings that can be modified.

$message = 'your_secret'
$secret = 'your_key'

$hmacsha = New-Object System.Security.Cryptography.HMACSHA256
$hmacsha.key = [Text.Encoding]::ASCII.GetBytes($secret)
$signature = $hmacsha.ComputeHash([Text.Encoding]::ASCII.GetBytes($message))
$signature = [Convert]::ToBase64String($signature)

echo $signature
echo -n "your_secret" | openssl dgst -sha256 -hmac "your_key" -binary | base64

Last updated

Was this helpful?