---
sourceDocument: Australia IT Service Management
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/it-service-management

 Release :

    - australia

ft:locale :

    - en-US

ft:publication_title :

    - Australia IT Service Management

ft:clusterId :

    - itsm

bundleId :

    - itsm

workflow :

    - Technology


---

# Set up OAuth 2.0 Authorization Code for Bitbucket Cloud

# Set up OAuth 2.0
Authorization
Code for Bitbucket Cloud {#ariaid-title1}

Release version: Australia  
Updated March 12, 2026  
![](https://www.servicenow.com/docs/portal-asset/ico-clock) 2 minutes to read  
Set up OAuth 2.0 Authorization Code credentials for Bitbucket in DevOps Change Velocity to use a more secure authentication method.

## Before you begin

The OAuth consumer must be created in the Bitbucket tool with the required permissions before creating the OAuth credential record. You can navigate to Workspace settings \> OAuth consumers \> Add consumer in Bitbucket to add the OAuth consumer. The following permissions must be selected when you create the credentials for OAuth 2.0.

* Account: Read
* Projects: Read
* Webhooks: Read and write
* Pull requests: Read

{#set-up-oauth-2-0-authorization-code__ul_ms1_nbm_52c}The This is a private consumer option must be deselected. You must enter your ServiceNow instance URL in the Callback URL field in the following format.

    https://<instanceurl>/oauth_redirect.do

You need the Client Id and Client secret values of your Bitbucket workspace. Client ID of your Bitbucket tool is available in the OAuth consumers section of your workspace settings (Workspace settings \> OAuth consumers \> Add consumer) in the Key field. Client secret of your Bitbucket tool is available in the OAuth consumers section of your workspace settings (Workspace settings \> OAuth consumers \> Add consumer) in the Secret field.

Role required: admin

## About this task

When you select the credential type as OAuth 2.0 - Authorization Code for Bitbucket Cloud, the repositories for all the workspaces are discovered. This is a limitation from Bitbucket side.

## Procedure

1. Navigate to AllSystem OAuthApplication Registry.
2. Select New.  
   The system displays the message What kind of OAuth application?
3. Select Connect to a third party OAuth Provider.  
   The system displays an empty Application Registries form.
4. Fill the following fields in the form.  
   {#set-up-oauth-2-0-authorization-code__table_fd2_2xr_4mb__entry__2}

   | Field | Value required |
   |-|-|
   | Name | Enter any name to uniquely identify the record. |
   | Client ID | Client ID of your Bitbucket tool, which is available in the OAuth consumers section of your workspace settings in the Key field of Bitbucket cloud. |
   | Client Secret | Client secret of your Bitbucket tool, which is available in the OAuth consumers section of your workspace settings in the Secret field of Bitbucket cloud. |
   | Default Grant type | Select Authorization Code. |
   | Authorization URL | Enter <kbd class="ph userinput">https://bitbucket.org/site/oauth2/authorize</kbd> |
   | Token URL | Enter <kbd class="ph userinput">https://bitbucket.org/site/oauth2/access_token</kbd> |
   [ ]

   {#set-up-oauth-2-0-authorization-code__table_fd2_2xr_4mb}
5. Leave the rest of the form fields as default.  
6. Select and hold (or right-click) the form header, and select Save.  
   * The system validates the OAuth credentials and populates the Redirect URL (Hint: It should match the User authorization callback URL previously provided in your Bitbucket Cloud configuration).
   * The system populates OAuth Entity Profile with Grant Type as Authorization Code. For example, OAuth Entity Profile is created with default Name, My Bitbucket App Provider default_profile
   {#set-up-oauth-2-0-authorization-code__ul_id2_2xr_4mb}
7. Navigate to AllConnections \& CredentialsCredentials.
8. Select New.  
   The system displays the message What type of Credentials would you like to create?.
9. Select OAuth 2.0 Credentials.  
   The pop-up window displays an empty OAuth 2.0 Credentials form.
10. Fill in these values.  
    {#set-up-oauth-2-0-authorization-code__table_sxv_zgp_gfb__entry__2}

    | Field | Value required |
    |-|-|
    | Name | Enter any name to uniquely identify the record. |
    | Active | Enable |
    | OAuth Entity Profile | Select the default OAuth Entity profile that you created in step 6. |
    | Applies to | Select the MID Servers that can use this credential. For example, select All MID Servers. Note: You must connect to your Bitbucket tool instance using MID Server to use this credential. |
    | Order | Select the order to apply this credential. For example, enter <kbd class="ph userinput">100</kbd>. |
    [ ]

    {#set-up-oauth-2-0-authorization-code__table_sxv_zgp_gfb}
11. Save the record.
12. Select the Get OAuth Token related link to generate the OAuth token.

*[\>]: and then


