TeamCity + Hub Redirect URI missing hostname

Answered

I've got two AWS instances running Hub and TeamCity, with nginx SSL proxies set up as well. Hub and Upsource are authenticating just fine. When I enable Hub login with TeamCity, I get the invalid_redirect_uri error but the URI it's trying to redirect to makes absolutely no sense. This is the message I'm seeing:

invalid_redirect_uri: Unregistered Redirect URI. Client service 'TeamCity' requests authorization entity for the URI which is not registered in Hub: http://:443/hubPlugin/login.html. If you have Hub administrator permissions and the suspicious URI does belong to 'TeamCity', please add this URI to the list of 'Redirect URIs' in the service settings in Hub

It looks like TeamCity isn't figuring out the hostname it's running on. The rootURL value in main-config.xml is "https://teamcity.groundctl.engineer". If I access TeamCity through the http port, 8112 then it does authenticate correctly. Of course if I disable the Hub integration then I can log in just fine to the SSL proxied port.

PS: I've noticed in the Symbol Server integrations admin page, TeamCity shows this for the built-in symbol server URL:

http://:443/app/symbols/

Presumably whatever method TC uses to determine the system's public hostname isn't working at all.

0
1 comment
Avatar
Permanently deleted user

Ahah! I found the issue. The guy that set up the nginx proxies forgot to set the server_name value in the config but was also rewriting the Host header with $server_name :P

0

Please sign in to leave a comment.