Login issue with Bitbucket integration
Hi.
Yesterday I have updated to the latest version of IntelliJ IDEA Ultimate (19.1.1) and after that I cannot push or pull to our company's Git repository on Bitbucket.
We have two-factor authentication enabled in Bitbucket settings and stuff, and until yesterday everything worked just fine. Also I can normally log in to my Bitbucket account using a browser or Sourcetree. But when trying to push / pull / fetch in IntelliJ IDEA, the "Git Login" pop-up window appears (with the pre-filled "Username" value) asking to enter a password:

IMPORTANT MOMENT
When performing login in a browser and trying to use Bitbucket account's "username", I get a warning saying that I can no longer login using my "username", but must use an email instead. And using my email I can successfully login.
So, can anyone help me with this issue?
Please sign in to leave a comment.
IntelliJ relies on the command line Git. Command line git does not support 2-factor authentication codes, and in this case, a token (app password in Bitbucket terms) must be used to authenticate. See https://intellij-support.jetbrains.com/hc/en-us/articles/206537004-How-to-access-GIT-remote-repositories-with-2-factor-authentication
Please grab an app password (or generate on via Bitbucket Web UI), and use it to authenticate. Use your Bitbucket username as a login, and app password as a password. At least is should work this way with the default configuration. Maybe an email can be used as a login, but it depends on the configuration.
See https://confluence.atlassian.com/bitbucket/app-passwords-828781300.html and https://confluence.atlassian.com/bitbucket/two-step-verification-777023203.html
Wow, thank you, Dmitriy. I have just created this so called "app password" in my Bitbucket account and it worked!
Other thoughts
I should have changed all my existing projects to use SSH instead of HTTPS as soon as we started to use two-factor authentication, then there would be no such issue. Will do that.
It's just strange that everything worked until the yesterday's update, but anyways.
Again, thanks for the quick help.
> should have changed all my existing projects to use SSH instead of HTTPS
Indeed, the right thing to do.
> It's just strange that everything worked until yesterday's update, but anyways.
Likely it happened because IDE now disabled git credential helper for commands it executes. See https://youtrack.jetbrains.com/issue/IDEA-177665
Probably you already have a token saved by a helper and it worked, authenticating on its own. Now IDE provides authentication data for git.
Ah, OK, I see.
setting "app password" in my Bitbucket account worked for me also. Thanks
I'm using app passwords and still keep getting the bitbucket branded popup showing every 2 minutes, the annoying thing is, because app passwods cant be viewed once they have been used i have to either store it in a notepad or generrate a new one every 5 minutes, It's becoming annoying, please fix it as Jetbrains is becoming a pain to use.
Hi Rob.
There could be 2 issues:
1. BitBucket specified custom Credential helper and due to enabled "Use credential helper" under Preferences | Version Control | Git you have this window
2. You may have it every 2 minutes due to "auto-fetch" feature of Git Toolbox plugin, so disabling a feature or a plugin would help