Slack Integration with TeamCity Not Working Due to Redirect URLs Issue

Hello everyone,

I am trying to integrate Slack with TeamCity to receive build notifications, particularly for failures.

I created a Slack app and proceeded with the integration. During the process, I encountered a requirement to add redirect URLs to my Slack app. However, these URLs must use HTTPS. Despite configuring everything as instructed, I am still encountering the following error:

Something went wrong when authorizing TeamCity Build Notifications.

Try going back to TeamCity Build Notifications and authorizing again. If problems persist, contact support for help.

Error details:

redirect_uri did not match any configured URIs. Passed URI: http://teamcity.exx.it-hxxx.dxx:80/admin/slack/auth/test.html

How can I resolve this issue? I have verified that the redirect URL in the global settings is correctly configured and functional.

I use Slack notifer plugin in teamcity connections under notifications.

Thank you for your help!

0
9 comments

Hi,

For security reasons, you need to add the HTTPS redirect URI when creating the Slack App. The redirect URL should be your TeamCity Server URL. You can also find instructions for this process when creating a Slack connection in TeamCity. Additionally, you can follow the tutorial to integrate TeamCity and Slack. https://www.jetbrains.com/teamcity/tutorials/integrations/integrate-teamcity-slack/
 

For proper authentication, add https://yourteamcityurl/, and any other server urls to the Redirect URLs in OAuth & Permissions | App Management.

Best Regards,
Tom

0

Hii,

Thanks for the response.

yes, I have used https:// and also its present in Global settings ,I have passed the same url but somehow when i click on add connections,
It shows http://myteamcityurl/ also to be added in slack app and I cannot add that (which i understood ) after saving the https://myteamcityurl/ and click on test connection, it throws an error redirect_uri did not match any configured URIs. Passed URI: http://teamcity.exx.it-hxxx.dxx:80/admin/slack/auth/test.html

every configuration is fine in slack app and global settings of teamcity but still i am getting the error like above!

Regards,
Harshetha

0
Hi,

Sorry for the delayed response.

Could you please share screenshots of the Slack app settings in OAuth & Permissions | App Management and the settings in TeamCity?

For further investigation, could you please capture the network trace file (https://learn.microsoft.com/en-us/azure/azure-web-pubsub/howto-troubleshoot-network-trace) when you click on "test connection" in TeamCity?

Files can be uploaded via https://uploads.jetbrains.com/. Please let us know the exact id after the upload.
0

Hello Tom,

I have uploaded the screenshots, I re installed the teamcity and also tried to add connection there, it shows to add http url whereas in Slack it does not allow to add http, and moreover , we added https and that one url should be enough to redirect but it is not working as expected! 

Thanks

0
Hi,

We need the upload id to get the uploaded files, could you please share the id after the upload?

For more detailed information, please refer to https://www.jetbrains.com/help/teamcity/reporting-issues.html#Uploading+Large+Data+Archives
0

Hi Tom,

Please find the upload id  below:
Upload id: 2024_08_07_pU1iZJbMAshtXbHcjMpgVK 

Thanks,
Harshetha

 

0
Hi Harshetha,

May I ask if you are using some sort of proxy in front of the server that uses http url?
It is possible that the proxy is not properly configured. If this is the case, please refer to the following guide on how to configure your proxy:
https://www.jetbrains.com/help/teamcity/configuring-proxy-server.html#Other+Servers

Please share the network trace file in .har or Fiddler format to instead of screenshots.

After uploading the above files, please provide the upload ID to us.
0

Hi , 
No we are not using proxy infront of the server that uses http url , we https enabled properly , i double checked that.

Please find the upload id 2024_08_09_r5Nybom5ZJjHUxY7bn35iS

Thanks,
Harshetha

 

0
Hi Harshetha,

Sorry for the late response.

Could you please share a screenshot of the Global Settings? We need to confirm the Server URL. Thanks for your cooperation.

Best Regards,
Tom
0

Please sign in to leave a comment.