# Adding Bitbucket organization to GitProtect

## Using OAuth

{% stepper %}
{% step %}
Log in to **GitProtect Management Service**, open the **DevOps** tab on the left side of the window, and select **Bitbucket** from the list.

<figure><img src="https://696332517-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtsE6XtJyUIEKVdSxPlS3%2Fuploads%2FbVjI36ILStEkqw2BBiGk%2Fimage.png?alt=media&#x26;token=e2af6128-2ff8-4741-9d5b-bf732ee66954" alt="" width="227"><figcaption></figcaption></figure>
{% endstep %}

{% step %}
Click the **Connect** button under **Bitbucket**.

<figure><img src="https://696332517-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtsE6XtJyUIEKVdSxPlS3%2Fuploads%2Fgit-blob-d293ef96e78f5e9567957dc296bb5274b7f42a74%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
A pop-up with **Bitbucket** login page will appear. Log in using your admin credentials and grant **GitProtect** access to the specified resources (when prompted).
{% endstep %}

{% step %}
Your **Bitbucket** organization has now been successfully added to **GitProtect**. Click **Customize policy** to adjust your backup policy settings, or click **Run now** to execute the backup immediately using the current policy configuration.
{% endstep %}
{% endstepper %}

***

## Using OAuth (Advanced Mode)

{% stepper %}
{% step %}
Log in to **GitProtect Management Service**, open the **DevOps** tab on the left side of the window, and select **Bitbucket** from the list.

<figure><img src="https://696332517-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtsE6XtJyUIEKVdSxPlS3%2Fuploads%2FbVjI36ILStEkqw2BBiGk%2Fimage.png?alt=media&#x26;token=e2af6128-2ff8-4741-9d5b-bf732ee66954" alt="" width="227"><figcaption></figcaption></figure>
{% endstep %}

{% step %}
Click the **advanced mode** link under **Bitbucket** and **Bitbucket DC** tiles.

<figure><img src="https://696332517-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtsE6XtJyUIEKVdSxPlS3%2Fuploads%2Fgit-blob-2e01c00a9b7e7edaeff7c223d2fb4130deb7398e%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
Set your authentication method.

1. In **Authentication**, select **Bitbucket**.
2. For **Connect using**, choose **OAuth App**.
3. In the **Settings** section, choose whether to enable **read-only mode** and whether **GitProtect** should automatically add new repositories to your backup.

{% hint style="warning" %}
If the **Read-Only Access** switch is enabled, the recovery options will be disabled.
{% endhint %}

<figure><img src="https://696332517-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtsE6XtJyUIEKVdSxPlS3%2Fuploads%2Fgit-blob-0599827191a4b2fe29bd06d19cd229596d8bbc16%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
Configure your repository sync and default worker. Specify hours for synchronization, or set a time interval for automatic updates.

<figure><img src="https://696332517-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtsE6XtJyUIEKVdSxPlS3%2Fuploads%2Fgit-blob-6e0b8920dbe6dd05504d35d8cb605902eb8a1c63%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
Click **Proceed** to complete adding your **Bitbucket** organization and grant **GitProtect** access to the specified resources (when prompted).

<figure><img src="https://696332517-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtsE6XtJyUIEKVdSxPlS3%2Fuploads%2Fgit-blob-1fdb2369214eec58d38166a3e616d30d552b5e8c%2Fimage%20(1136).png?alt=media" alt=""><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}

***

## Using an API token

{% stepper %}
{% step %}
Log in to **GitProtect Management Service**, open the **DevOps** tab on the left side of the window, and select **Bitbucket** from the list.

<figure><img src="https://696332517-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtsE6XtJyUIEKVdSxPlS3%2Fuploads%2FbVjI36ILStEkqw2BBiGk%2Fimage.png?alt=media&#x26;token=e2af6128-2ff8-4741-9d5b-bf732ee66954" alt="" width="227"><figcaption></figcaption></figure>
{% endstep %}

{% step %}
Click the **advanced mode** link under **Bitbucket** and **Bitbucket DC** tiles.

<figure><img src="https://696332517-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtsE6XtJyUIEKVdSxPlS3%2Fuploads%2Fgit-blob-2e01c00a9b7e7edaeff7c223d2fb4130deb7398e%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
Set your authentication method.

1. In **Authentication**, select **Bitbucket**.
2. For **Connect using**, choose **Username and App password**.
3. Enter your **Bitbucket** email address.
4. Add or select **App Password** that contains your API token from the **Password Manager**.
5. Choose whether **GitProtect** should automatically add new repositories to your backup.

<figure><img src="https://696332517-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtsE6XtJyUIEKVdSxPlS3%2Fuploads%2Fgit-blob-fafe3f3b3c6fdeb2987659c083c120a40edeb4b2%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
Configure your repository sync and default worker. Specify hours for synchronization, or set a time interval for automatic updates.

<figure><img src="https://696332517-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtsE6XtJyUIEKVdSxPlS3%2Fuploads%2Fgit-blob-5ab58a4516d8c4e632f19414df90102f4b3256ba%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
Click **Proceed** to complete adding your **Bitbucket** organization and grant **GitProtect** access to the specified resources.
{% endstep %}
{% endstepper %}

***

## Additional browser permissions

When adding an organization, you may be prompted to grant additional permissions to the **GitProtect** application—make sure your browser allows **GitProtect** to open pop-up windows.

<figure><img src="https://696332517-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtsE6XtJyUIEKVdSxPlS3%2Fuploads%2Fgit-blob-c58cd6d726e43d47a8a4031beb8052c9a7081f35%2F1%20(4).PNG?alt=media" alt=""><figcaption></figcaption></figure>

Depending on your browser, you can either adjust the settings to allow pop-ups or permit the authorization window to open once.

<figure><img src="https://696332517-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtsE6XtJyUIEKVdSxPlS3%2Fuploads%2FH587HP4uqmumoshAJKZh%2Fimage.png?alt=media&#x26;token=fbbdb1b9-02a3-4d7c-934d-81dfdd77baf0" alt="Mozilla pop-up allowance"><figcaption></figcaption></figure>

***

## Useful links and items

{% embed url="<https://support.atlassian.com/bitbucket-cloud/docs/create-an-api-token>" %}
