Skip to content

Reference

Bitbucket

Set up Bitbucket OAuth for repository management and CI/CD pipelines

Connect your users to Bitbucket for repository management, pull requests, and CI/CD pipelines.

PropertyValue
Provider IDbitbucket
CategoryDeveloper Tools
PKCENot supported
Token refreshAutomatic
Redirect URIShown in Developer Portal

Go to Bitbucket workspace settings

Sign in to Bitbucket, open the workspace’s settings (Settings cog → Workspace settings), then under Apps and features select OAuth clients.

Create an OAuth client

Click Create OAuth client. Enter the application name.

Add the callback URL

Add the Redirect URI from the Developer Portal to the Callback URL field.

Select permissions

Select the required permissions for the application.

Get credentials

Copy the Client ID and Secret.

Open the Developer Portal

Go to portal.alterauth.com and navigate to the application.

Add Bitbucket provider

Go to OAuth Providers > Add Provider > Bitbucket.

Enter credentials

  • Client ID: Paste the Bitbucket Client ID
  • Client Secret: Paste your Bitbucket Secret

Select scopes

Choose the scopes the application needs.

Save

Click Save. The provider is now active.

ScopeDescription
accountRead the user’s account information (email addresses, name, SSH keys, groups) and, on workspace APIs, the workspace’s users, permissions and projects — gates GET /2.0/user, the identity call
account:writeChange properties on the user’s account (groups, email addresses, username, display name, avatar; delete the account)
emailSee the user’s primary email address
repositoryRead access to repositories: source code, HTTPS clone, file browsing, zip downloads, and view/use the issue tracker and wiki
repository:writeWrite (not admin) access to repositories: push over HTTPS and fork — implicitly grants repository
repository:adminAdmin features of a repository (permissions, branch permissions, deploy keys, webhooks, default reviewers, ownership transfer) — does not grant read or write access to its contents
repository:deleteDelete a repository or repositories
projectView projects — implies repository (read access to every repository in the project)
project:adminCreate, update and delete projects — does not grant project or repository:write
pullrequestRead access to pull requests (list, comment, create and resolve tasks) — implies repository
pullrequest:writeCreate, approve, merge and decline pull requests — implicitly grants pullrequest and repository:write
issueView, list, search, create, comment on, watch and vote for issues (no implicit repository access)
issue:writeTransition and delete issues — implicitly grants issue
wikiRead and write access to wikis (view, create and edit pages, clone and push)
webhookList, create, update and delete webhook subscriptions on any accessible repository, user, workspace or snippet
snippetRead access to snippets and create snippet comments
snippet:writeCreate, edit and delete snippets — implicitly grants snippet
pipelineRead-only access to pipelines, steps, deployment environments and variables
pipeline:writeStop, rerun, resume and manually trigger pipelines (does not create variables)
pipeline:variableCreate pipeline variables at the workspace, repository and deployment levels
runnerRead-only access to pipeline runners set up against a workspace or repository
runner:writeCreate, edit, disable and delete pipeline runners set up against a workspace or repository
  • Atlassian’s documentation still calls an OAuth client an OAuth consumer; the workspace UI lists them under Apps and features → OAuth clients and shows the client id as Client ID.
  • Bitbucket defines scopes on the OAuth client itself: the scopes selected in Alter Vault must also be enabled on the client’s permissions, or the authorization request fails (requesting fewer scopes than the client has is fine). Access tokens expire after two hours and are refreshed automatically.
  • project:write is not offered: Atlassian documents it as deprecated and obsoleted by project:admin.
  • See the Bitbucket OAuth documentation for more details.

Alter policy rules can target these attested operations and families for operation-level and parameter-aware controls.

Operation IDFamiliesMethodProvider pathNotes
post:/repositories/{workspace}/{repo_slug}/commit/{commit}/commentsadmin, sendPOST/2.0/repositories/{workspace}/{repo_slug}/commit/{commit}/comments—
post:/repositories/{workspace}/{repo_slug}/issues/{issue_id}/commentsadmin, sendPOST/2.0/repositories/{workspace}/{repo_slug}/issues/{issue_id}/commentsserved by the provider but absent from its published spec
post:/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/commentsadmin, sendPOST/2.0/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/comments—
post:/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/comments/{comment_id}/resolveadmin, sendPOST/2.0/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/comments/{comment_id}/resolve—
post:/snippets/{workspace}/{encoded_id}/commentsadmin, sendPOST/2.0/snippets/{workspace}/{encoded_id}/comments—
put:/repositories/{workspace}/{repo_slug}/commit/{commit}/comments/{comment_id}admin, sendPUT/2.0/repositories/{workspace}/{repo_slug}/commit/{commit}/comments/{comment_id}—
put:/repositories/{workspace}/{repo_slug}/issues/{issue_id}/comments/{comment_id}admin, sendPUT/2.0/repositories/{workspace}/{repo_slug}/issues/{issue_id}/comments/{comment_id}served by the provider but absent from its published spec
put:/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/comments/{comment_id}admin, sendPUT/2.0/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/comments/{comment_id}—
put:/snippets/{workspace}/{encoded_id}/comments/{comment_id}admin, sendPUT/2.0/snippets/{workspace}/{encoded_id}/comments/{comment_id}—
delete:/repositories/{workspace}/{repo_slug}admin, deleteDELETE/2.0/repositories/{workspace}/{repo_slug}—
delete:/repositories/{workspace}/{repo_slug}/branch-restrictions/{id}admin, deleteDELETE/2.0/repositories/{workspace}/{repo_slug}/branch-restrictions/{id}—
delete:/repositories/{workspace}/{repo_slug}/commit/{commit}/approveadmin, deleteDELETE/2.0/repositories/{workspace}/{repo_slug}/commit/{commit}/approve—
delete:/repositories/{workspace}/{repo_slug}/commit/{commit}/comments/{comment_id}admin, deleteDELETE/2.0/repositories/{workspace}/{repo_slug}/commit/{commit}/comments/{comment_id}—
delete:/repositories/{workspace}/{repo_slug}/default-reviewers/{target_username}admin, deleteDELETE/2.0/repositories/{workspace}/{repo_slug}/default-reviewers/{target_username}—
delete:/repositories/{workspace}/{repo_slug}/deploy-keys/{key_id}admin, deleteDELETE/2.0/repositories/{workspace}/{repo_slug}/deploy-keys/{key_id}—
delete:/repositories/{workspace}/{repo_slug}/downloads/{filename}admin, deleteDELETE/2.0/repositories/{workspace}/{repo_slug}/downloads/{filename}—
delete_repository_hookadmin, deleteDELETE/2.0/repositories/{workspace}/{repo_slug}/hooks/{uid}also accepts delete:/repositories/{workspace}/{repo_slug}/hooks/{uid}
delete:/repositories/{workspace}/{repo_slug}/issues/{issue_id}admin, deleteDELETE/2.0/repositories/{workspace}/{repo_slug}/issues/{issue_id}served by the provider but absent from its published spec
delete:/repositories/{workspace}/{repo_slug}/issues/{issue_id}/attachments/{path}admin, deleteDELETE/2.0/repositories/{workspace}/{repo_slug}/issues/{issue_id}/attachments/{path}served by the provider but absent from its published spec
delete:/repositories/{workspace}/{repo_slug}/issues/{issue_id}/comments/{comment_id}admin, deleteDELETE/2.0/repositories/{workspace}/{repo_slug}/issues/{issue_id}/comments/{comment_id}served by the provider but absent from its published spec
delete:/repositories/{workspace}/{repo_slug}/issues/{issue_id}/voteadmin, deleteDELETE/2.0/repositories/{workspace}/{repo_slug}/issues/{issue_id}/voteserved by the provider but absent from its published spec
delete:/repositories/{workspace}/{repo_slug}/issues/{issue_id}/watchadmin, deleteDELETE/2.0/repositories/{workspace}/{repo_slug}/issues/{issue_id}/watchserved by the provider but absent from its published spec
delete:/repositories/{workspace}/{repo_slug}/permissions-config/groups/{group_slug}admin, deleteDELETE/2.0/repositories/{workspace}/{repo_slug}/permissions-config/groups/{group_slug}—
delete:/repositories/{workspace}/{repo_slug}/permissions-config/users/{selected_user_id}admin, deleteDELETE/2.0/repositories/{workspace}/{repo_slug}/permissions-config/users/{selected_user_id}—
delete:/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/approveadmin, deleteDELETE/2.0/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/approve—
delete:/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/comments/{comment_id}admin, deleteDELETE/2.0/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/comments/{comment_id}—
delete:/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/comments/{comment_id}/resolveadmin, deleteDELETE/2.0/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/comments/{comment_id}/resolve—
bulkCreateOrUpdateAnnotationsadmin, writePOST/2.0/repositories/{workspace}/{repo_slug}/commit/{commit}/reports/{reportId}/annotations—
createDeploymentVariableadmin, writePOST/2.0/repositories/{workspace}/{repo_slug}/deployments_config/environments/{environment_uuid}/variables—
createEnvironmentadmin, writePOST/2.0/repositories/{workspace}/{repo_slug}/environments—
createOrUpdateAnnotationadmin, writePUT/2.0/repositories/{workspace}/{repo_slug}/commit/{commit}/reports/{reportId}/annotations/{annotationId}—
createOrUpdateReportadmin, writePUT/2.0/repositories/{workspace}/{repo_slug}/commit/{commit}/reports/{reportId}—
post:/snippetswritePOST/2.0/snippets—
put:/addonwritePUT/2.0/addon—
get:/repositories/{workspace}/{repo_slug}/commit/{commit}/commentsreadGET/2.0/repositories/{workspace}/{repo_slug}/commit/{commit}/comments—
get:/repositories/{workspace}/{repo_slug}/commit/{commit}/comments/{comment_id}readGET/2.0/repositories/{workspace}/{repo_slug}/commit/{commit}/comments/{comment_id}—
get:/repositories/{workspace}/{repo_slug}/components/{component_id}readGET/2.0/repositories/{workspace}/{repo_slug}/components/{component_id}served by the provider but absent from its published spec
get:/repositories/{workspace}/{repo_slug}/deploy-keysreadGET/2.0/repositories/{workspace}/{repo_slug}/deploy-keys—
get:/repositories/{workspace}/{repo_slug}/deploy-keys/{key_id}readGET/2.0/repositories/{workspace}/{repo_slug}/deploy-keys/{key_id}—
get:/repositories/{workspace}/{repo_slug}/downloads/{filename}readGET/2.0/repositories/{workspace}/{repo_slug}/downloads/{filename}—

Report an issue with this page

Necessary

Required for sign-in, security, authorization, and remembering your choices.

Always active

Analytics

Helps us understand which product and documentation features are useful.

Performance diagnostics

Uses performance tracing and privacy-masked session replay to diagnose problems.

You can change these choices at any time from Cookie settings.