Background
Bitbucket Cloud no longer accepts account passwords for Git operations against repositories. Authentication requires an API token instead.
JetBrains IDEs (IntelliJ IDEA, PhpStorm, WebStorm, PyCharm, RubyMine, GoLand, Rider, and others) prompt for Git credentials the first time a remote operation (clone, fetch, pull, push) runs against a Bitbucket repository, and reuse the stored credentials afterward. There is no dedicated "Bitbucket integration" settings screen for entering the token — it is provided through the standard Git authentication dialog.
Question
How to authenticate against Bitbucket repositories from a JetBrains IDE when the account password is no longer accepted?
Answer
- On Bitbucket, generate an API token with scopes that include the required repository permissions (for example,
read:repository:bitbucketandwrite:repository:bitbucket). A plain API token without scopes is not accepted for Git authentication.
Using the command line instead of the IDE? You're done after this step — just run your Git command and, when prompted for a password, paste the scoped token:
git clone https://<your-bitbucket-username>@bitbucket.org/<workspace>/<repo>.git
# Username for 'https://bitbucket.org': <your-bitbucket-username>
# Password for 'https://<username>@bitbucket.org': <paste the scoped API token>
- In the IDE, clear any cached Bitbucket credentials so that the authentication dialog appears again:
- Open Settings (Ctrl+Alt+S on Windows/Linux, ⌘, on macOS).
- Navigate to Appearance & Behavior | System Settings | Passwords.
- Select Do not save, forget passwords after restart.
- Click OK and restart the IDE.
- Trigger any remote Git operation against the Bitbucket repository (clone, fetch, pull, or push). The IDE displays the Log In to Bitbucket dialog.
- Enter the Bitbucket account username (or email) and paste the API token with scopes into the password field. Confirm.
- After successful authentication, restore the preferred password storage option (for example, In native Keychain) under Settings | Appearance & Behavior | System Settings | Passwords.
Additional information
- The same API token with scopes also works for Git authentication from the command line outside the IDE. If
git clonefrom a terminal also fails with the token, the issue is in token configuration (missing scopes), not in the IDE. - For more details on how the IDE manages remote Git credentials, see Set passwords for Git remotes.
- Cached credentials can alternatively be removed from the OS credential storage (macOS Keychain, Windows Credential Manager, or the appropriate Linux keyring) before retrying the Git operation.
- As BitBucket integration is not supported natively in the IDE (as GitHub or GitLab), there is no place in IDE settings to configure the API token or credentials.
Troubleshooting
If the IDE is not prompting the authentication dialog, check whether the option - File | Settings | Version Control | Git | Update | Use credential helper is disabled. When enabled, invalid credentials can potentially be stored in the external credential helper, which the IDE reuses automatically.
Comments
0 comments
Please sign in to leave a comment.