Access Tokens

Description

Starting with Bitbucket 5.5 (server and data center), you can use personal access tokens many CLI actions and REST API requests instead of using basic authentication with user and password. See Bitbucket Personal Access Tokens for more details. An access token can be specified on the token parameter on CLI actions related to repositories.

The CLI also supports actions for managing access tokens: add, remove, and getAccessTokenList.

From the UI, go to Manage account and Personal access tokens.

For Bitbucket Cloud, a similar thing is available called App passwords (see below for more information). From a browser: Login → View profile → Settings → App passwords.

For more information, see Authentication.

Permission Table

See the Atlassian documentation for the current information. Here is a snapshot of that with some additional information including the valid values for the permission parameter on addAccessToken.


Project read - PROJECT_READProject write - PROJECT_WRITEProject admin - PROJECT_ADMIN

Repository read

REPO_READ

(tick) Pull and clone repositories

(error)

(error)

Repository write

REPO_WRITE

(tick) Perform pull request actions

(tick) Push, pull, and clone repositories

(tick) Perform pull request actions

(tick) Push, pull, and clone repositories

(error)

Repository admin

REPO_ADMIN

(tick) Perform pull request actions

(tick) Update repository settings and permissions

(tick) Push, pull, and clone repositories

(tick) Perform pull request actions

(tick) Update repository settings and permissions

(tick) Push, pull, and clone repositories

(tick) Perform pull request actions

(tick) Update repository settings and permissions

(tick) Update project settings and permissions

(tick) Push, pull, clone, and fork repositories

(tick) Create repositories

Examples

--action addAccessToken  --name "project-admin"  --permission "PROJECT_ADMIN, REPO_ADMIN"

Other Information

  • BSERV-10482 - Create admin personal tokens for admin endpoints in Bitbucket Server REST API

Cloud App Passwords

App passwords are substitute passwords for a user account which you can use for scripts and integrating tools to avoid putting your real password into configuration files.

For more information, see: App Passwords.

Use account name with app passwords

Make sure you use your Bitbucket account name and NOT your email address when using App passwords!


  • Login → View profile → Settings → App passwords