Overview
Torii integrates with SonarQube Server and syncs:
- Users, including their name, email, status (active or deactivated), role (Admin or User) and last login time. Deactivated users have no email or last login time, because SonarQube clears them on deactivation.
- Licenses: one license named SonarQube.
- You can constantly stay updated with application information from our Integrations Page >> Integration Capabilities button >> Integration Capabilities table.
This integration is for self-hosted SonarQube Server. It does not support SonarQube Cloud. The integration might not yet be enabled for your Torii organization. If you do not see it on the Integrations page, contact Torii Support.
Requirements
To connect this integration, we require the following:
Accounts & Permissions
- A SonarQube user that holds the global Administer System permission. We recommend a dedicated user that holds only this permission (see the steps below).
- Your SonarQube Server must be reachable from Torii over the network.
- Any SonarQube Server edition, including the free Community Build. All editions include the Web API.
Required keys
- SonarQube Server URL - the address of your server, for example https://sonarqube.company.com (without a trailing slash).
- User token - a token of type "User" generated by the SonarQube user above.
How to Generate the Required Values
Follow these steps to generate the required values:
Step 1: Create a dedicated user and grant it the Administer System permission
- Sign in to SonarQube as an administrator and create a new user for Torii (for example, "torii-integration").
- Go to Administration >> Security >> Global Permissions.
- Search for the new user.
- In the permissions grid, select the Administer System check box for that user. Do not grant any other permission.
Step 2: Generate a user token
- Sign in to SonarQube as the new user.
- Open the account menu and go to My Account >> Security.
- In the Generate Tokens form, enter a name for the token and set the type to User token.
- Choose an expiration. Select No expiration if your administrator allows it. Otherwise choose the longest available expiration, and generate a new token in Torii before it expires.
- Click Generate and copy the token.
Important
The token is shown only once. Copy it before you close the notification, as you cannot retrieve it later.
Alternatively, you can generate the token as an existing administrator. This works, but grants Torii more access than it needs.
How to Connect the Integration
- Go to the Integrations page in Torii.
- Search for SonarQube and click Connect.
- Enter the SonarQube Server URL and the user token.
- Click Connect.
Actions
- Create SonarQube user - creates a user in SonarQube with the email address as the login and no password. See the Q&A below for limitations.
- Deactivate SonarQube user - deactivates the user in SonarQube. The user is not anonymized and can be reactivated.
- Change SonarQube user role - changes the user's role to Admin or User by adding or removing the user from the SonarQube sonar-administrators group.
All actions require the token user to hold the Administer System permission.
Q&A
Q: Who can sign in to a user created by the Create User action?
A: The user is created without a password and is linked to the person at their first sign-in only when your SonarQube Server uses LDAP. With SAML, GitHub, GitLab or Bitbucket sign-in, SonarQube creates a separate account at first sign-in instead. Instances where users are managed externally reject this action and the Change SonarQube user role action, and email addresses containing "+" are not supported.
Q: How is the Admin role determined?
A: A user is shown as Admin when they are a member of the sonar-administrators group. Users who have administrator permissions through another group or a direct permission are shown as User.
For any further questions, please contact Torii Support.