Using Commit Status Publisher with Bitbucket cloud and two factor authentication

We have repositories in BitBucket Cloud and have enabled two factor authentication. Now we want to enable Bitbucket PR Build Integration with Team City so that our PRs in BitBucket are validated with the status of the builds in Team City.

We do not want to expose our Bitbucket Cloud repos using OAuth authentication even though only READ operations would be allowed.

Our team city server is not exposed to the internet but should be able to publish build status of certain build configurations to Bitbucket Cloud using the "Commit Status Publisher" plugin.

The problem is that the "Commit Status Publisher" plugin does not support two factor authentication. Do you have any suggestion on how we could solve this?

Official comment

Hi Patrik,

Two-factor authentication is supposed to be used by users, but not by services, so it is not a question of Commit Status Publisher supporting the 2FA, but a question of picking another way to authenticate it. As it does only support username/password pair for Bitbucket Cloud it is natural to use application passwords for that. You can create such a password in Settings -> App Passwords. The required scope is Repositories  Read / Write

Please let us know if it doesn't work for you.

Thank you. That helped. Why are you forcing the Url of the build server to have a certain format? Ours just has a name and a port number, in the form server:8081. Still I got it to work. Thanks again.


Hi Patrik, it's not like we are demanding the Server URL to be a fully qualified domain name. It's just Commit Status Publisher passes the build page URL with the status to Bitbucket Cloud, which does not accept URLs without a FQDN host name in these URLs.


Please sign in to leave a comment.