SonarQube
Set up SonarQube code analysis with Pocket ID
Requirements
- SonarQube Community
- sonar-auth-oidc plugin v3.0.0 (or later)
- HTTPS connection to your SonarQube instance
Create OIDC Client in Pocket ID
Create a new OIDC Client in Pocket ID (e.g.,
sonarqube).Set the Callback URL to the value below, or leave blank to autofill on first login.
Optional: Download a PNG or SVG logo from the SonarQube Community and upload.
Copy the Client ID, Client Secret, and OIDC Discovery URL for use in the next section.
Install and configure the plugin
Download sonar-auth-oidc v3.0.0 (or later) and copy it into the SonarQube plugins directory, usually
/opt/sonarqube/extensions/pluginsRestart SonarQube instance.
Go to Administration -> Configuration -> Security and set the following parameters
- Enabled:
true(checked) - Issuer URI: your
OIDC Discovery URLwithout /.well-known/openid-configuration - Client ID: your
Client ID - Client secret: your
Client Secret - Scopes:
openid email profile groups - Allow users to sign-up:
true(checked) (optional but recommended) - Login generation strategy:
Email
- Enabled:
Controlling admins access with groups
To control admin access to SonarQube using Pocket ID groups:
Create your Pocket ID group.
Add a
Custom Claiminside group to match SonarQube admin group.Note: Value must be a JSON array.
- Key:
sonargroups - Value:
["sonar-administrators"]
- Key:
Go to SonarQube -> Administration -> Configuration -> Security and set
- Synchronize groups:
true(checked) - Groups claim name:
sonargroups
- Synchronize groups:
This will cause SonarQube to automatically add the members of the Pocket ID group to the SonarQube sonar-administrators administration group.
Additional information
More information about sonar-auth-oidc can be found here.
Hint: Thanks to Pocket ID Custom Claims it is possible to completely manage SonarQube groups via Pocket ID.