# Bitbucket Cloud

To allow users to log in with Bitbucket Cloud credentials, you need to use an [OAuth consumer](https://support.atlassian.com/bitbucket-cloud/docs/use-oauth-on-bitbucket-cloud/) and set the authentication settings in SonarQube. See the following sections for more on setting up authentication.

### Setting your OAuth consumer settings <a href="#setting-your-oauth-consumer-settings" id="setting-your-oauth-consumer-settings"></a>

Create your OAuth consumer in your Bitbucket Cloud workspace settings and specify the following:

* **Name**: The name of your OAuth consumer.
* **Callback URL:** Your SonarQube instance URL.
* **Permissions**:
  * **Account**: **Read** and **Email** access.
  * **Workspace membership**: **Read** access.

### Setting your authentication settings in SonarQube <a href="#setting-your-authentication-settings-in-sonarqube" id="setting-your-authentication-settings-in-sonarqube"></a>

To set your global authentication settings, navigate to **Administration > Configuration > General Settings > Authentication > Bitbucket Cloud Authentication** and update the following settings:

* **Enabled**: Set to true.
* **OAuth consumer key**: Enter the **Key** from your OAuth consumer page in Bitbucket.
* **OAuth consumer secret**: Enter the **Secret** from your OAuth consumer page in Bitbucket.
* **Workspaces**: Only users from Bitbucket Workspaces that you add here will be able to authenticate in SonarQube. This is optional but *highly* recommended to ensure only the users you want to log in with Bitbucket credentials are able to.

### Bitbucket Cloud group synchronization <a href="#bitbucket-cloud-group-synchronization" id="bitbucket-cloud-group-synchronization"></a>

Group synchronization is not supported for Bitbucket.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.sonarsource.com/sonarqube-server/10.3/instance-administration/authentication/bitbucket-cloud.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
