Commit Status Publisher token based auth
I've tried to describe the problem in https://youtrack.jetbrains.com/issue/TW-52191/Add-support-for-token-authentication-in-BitBucket-Server-for-build-status-API but no one replied there yet.
TC version 2023.05
I want to create N build configurations in TC with Commit Status Publisher feature enabled, each of them will point to the same BitBucket Server instance but different repos. I want to use token based auth, not basic login/password auth. Preferably this should be a single token for all N builds.
Commit Status Publisher allows to use tokens but it uses OAuth 2.0 for this. I've created an app link between BitBucket and TC (Root level Connection is terms of TC) as described here.
When I press the Acquire button in the Commit Status Publisher of the first build configuration - all goes well, Test Connection passes, it works.
When I try to do the same in the next build configuration in the same Project - Acquire button works, Test Connection also works.
When I try to do the same in the next build configuration in a different Project - Acquire button works, but Test Connection returns an error “Connection failed! The configured authentication with the tc_token_id:CID_xxx ID is missing or invalid.”
So the problem is that I want to use a single token that was generated in BitBucket Server to be able to publish build statuses to different BitBucket repos. Currently we use login/pass for this. I tried to switch to tokens that CSP provides and it appears that either there is a bug related to VCS roots being configured in different TeamCity projects or this feature is just not designed to used in that way.
Please sign in to leave a comment.
We have asked our development team to reply to the YouTrack issue mentioned above. They will get back to you as soon as possible.
Regards,
Guilherme
Seeing a similar issue when using Bitbucket Cloud.
I get this when clicking “Test Connection”:
The configured authentication with the tc_token_id:some_long_id_here ID is missing or invalid.
Works fine for some projects so I don't know why the connection is failing here.
Looking more into this, it seems that TeamCity is assigning either a duplicate ID or an empty ID.