This plugin enables user authentication and Single Sign-On via Bitbucket. 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
- 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 |
sonar.auth.bitbucket.apiUrl | Allows configurable bitbucket api url for pointing it to your bitbucket server. This will allow users & credentials to be reused from configured bitbucket | https://api.bitbucket.org// |
To provide feedback (request a feature, report a bug etc.) use the SonarQube Google Group. Please do not forget to specify plugin and SonarQube versions if it relates to a bug.
If you have a question on how to use plugin direct it to StackOverflow tagged both sonarqube
and bitbucket
.