This plugin enables user authentication and Single Sign-On via Bitbucket server. If you want to analyse Bitbucket Pull Requests you should use this or this plugin.
- Install the plugin through the Update Center or download it into the SONARQUBE_HOME/extensions/plugins directory
- Restart the SonarQube server
- In Bitbucket, create a Developer application :
- Go to "Add-ons" -> "OAuth" -> "Add consumer"
- Name : Something like "My Company SonarQube"
- URL : SonarQube URL
- Callback URL : SonarQube_URL/oauth2/callback
- Permissions : Check Account -> Read (Email will automatically be selected)
- In SonarQube :
- Go to "Administration" -> "Configuration" -> "General Settings" -> "Security" -> "Bitbucket"
- Set the "Enabled" property to true
- Set the "OAuth consumer Key" from the value provided by the Bitbucket OAuth consumer
- Set the "OAuth consumer Secret" from the value provided by the Bitbucket OAuth consumer
- Set the "Bitbucket server URL" to know where's your private Bitbucket server locates
- Set the "Private signing key" to sign oauth requests
- Go to the login form, a new button "Log in with Bitbucket" allow users to connect to SonarQube with their Bitbucket accounts.
Note: Only HTTPS is supported
- SonarQube must be publicly accessible through HTTPS only
- The property 'sonar.core.serverBaseURL' must be set to this public HTTPS URL
Property | Description | Default value |
---|---|---|
sonar.auth.bitbucket.allowUsersToSignUp | Allow new users to authenticate. When set to 'false', only existing users will be able to authenticate to the server | true |
sonar.auth.bitbucket.clientId.secured | Consumer Key provided by Bitbucket when registering the consumer | None |
sonar.auth.bitbucket.clientSecret.secured | Consumer password provided by Bitbucket when registering the consumer | None |
sonar.auth.bitbucket.enabled | Enable Bitbucket users to login. Value is ignored if consumer Key and Secret are not defined | false |
sonar.auth.bitbucket.loginStrategy | When the login strategy is set to 'Unique', the user's login will be auto-generated the first time so that it is unique. When the login strategy is set to 'Same as Bitbucket login', the user's login will be the Bitbucket login. This last strategy allows, when changing the authentication provider, to keep existing users (if logins from new provider are the same than Bitbucket) | Unique |