Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot setup OAuth with TeamCity

dkuerten
April 17, 2026

I have set up a TeamCity Server and am currently in the progress of connecting it to a Bitbucket Repository.

When adding the connection I am required to setup OAuth to be able to add repositories. The instructions provided by the server are to add an OAuth consumer with the following parameters:

URL: http://<server-ip>:<server-port>

Callback URL: http://<server-ip>:<server-port>/oauth/bitbucket/

But I am unable to add the consumer in Bitbucket and always get the error "For HTTP protocols, the callback URL must be a loopback address.". I already tried different combinations with localhost and none worked so far. Changing the url and callback url both to localhost does work but the Server is unable to perform the authentication.

1 answer

0 votes
Mark C
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 20, 2026

Hi @dkuerten

Welcome to the community.

Have you tried a callback URL without the port?

Regards,
Mark C

dkuerten
April 21, 2026

Yes, but that also does not work. I get the same loopback error message.

Mark C
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 13, 2026

Hi @dkuerten

I see, could you please confirm if it is accessible via HTTPS?

If not, you may need to setup TLS/SSL for the endpoint as it is required to be trusted for Bitbucket Cloud.

Regards,
Mark C

dkuerten
May 13, 2026

Changing the callback URL to HTTPS does work in Bitbucket. But when I try to add a token I get an "Invalid redirect_uri" error.

I am unable to setup TLS/SSL as the server is running in an internal network and does not has a DNS entry. Correct me if I'm wrong, because I am no expert on that.

I previously managed to setup the server on my local machine with OAuth without any issues so I am not sure whats makes the difference when trying it on a server within the network?

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Product Admin Site Admin
TAGS
AUG Leaders

Atlassian Community Events