Skip to content
Last updated

Bitbucket integration

Bitbucket is a Git-based code hosting and collaboration platform built for teams. Integrating Bitbucket with Frontegg allows your application to access repositories, pull requests, and issues on behalf of your users through OAuth 2.0 authentication.


Prerequisites

  • A Bitbucket account with access to a workspace
  • Admin access to the Bitbucket workspace settings

Connect Bitbucket

Step 1: Open the OAuth consumers settings

Log in to Bitbucket and navigate to your workspace. Click Settings in the left sidebar, then expand Apps and features and click OAuth consumers. Click Add consumer to create a new OAuth application.

Bitbucket OAuth consumers

Step 2: Fill in the application details

In the Add OAuth consumer form, fill in the following fields:

  • Name — Enter a descriptive name (e.g., "Frontegg Integration")
  • Callback URL — Enter the Frontegg redirect URI: https://YOUR_MCP_GATEWAY_URL/integration-callback
  • URL — Enter your application homepage URL

Bitbucket application details form

Step 3: Configure permissions

Scroll down to the Permissions section and select the scopes your application requires:

ScopeDescription
accountRead account information
repositoryRead repositories
repository:writeWrite to repositories
pullrequestRead and write pull requests
issueRead and write issues

Minimum required scopes

For basic functionality, select account and repository. Add pullrequest and issue if your application needs to work with pull requests or issues.

Bitbucket permissions configuration

Step 4: Save the consumer

Click Save at the bottom of the form to create your OAuth consumer.

Bitbucket save button

Step 5: Confirm creation

After saving, you are redirected back to the OAuth consumers list. A confirmation message appears and your new consumer is listed in the table.

Bitbucket consumer created

Step 6: Copy credentials

Click on the name of your consumer in the list to expand its details. Copy the Key (Client ID) and Secret (Client Secret) values — you will need them to configure the integration in the Frontegg portal.

Keep your credentials secure

Never share or commit your Client Secret to version control.

Bitbucket credentials

Step 7: Find your workspace slug

In addition to the OAuth credentials, you need your Bitbucket workspace slug. Click Settings in the left sidebar of your workspace, then open Workspace settings. The Workspace ID field displays your workspace slug — copy this value.

You can also find the slug directly in any of your workspace URLs. For example, in https://bitbucket.org/my-team/, the workspace slug is my-team.

Bitbucket workspace ID

Configure the Frontegg portal

Once you have obtained your Key (Client ID), Secret (Client Secret), and workspace slug from the steps above, enter them in the integration configuration page of the Frontegg portal:

  1. Open the Frontegg portal and navigate to [ENVIRONMENT] → Integrations → Bitbucket.
  2. Enter the Key as the Client ID and Secret as the Client Secret in the corresponding fields.
  3. Enter your Bitbucket workspace slug in the Bitbucket workspace slug field (for example, my-team).
  4. Select the required scopes.
  5. Click Save.

Additional resources