This Question is Possibly Answered

1 "correct" answer available (4 pts) 2 "helpful" answers available (2 pts)
4 Replies Last post: Dec 1, 2012 10:30 PM by Eduardo Radanovitsck  
_Davis_ Newbie 5 posts since
Oct 12, 2011
Currently Being Moderated

Dec 3, 2012 12:04 PM

Rest API Authentication Integrated

Hello, hopefully someone can help me:


We would like to remote run a TeamCity build from another website.

What I did was set up a build configuration with some predefined (but empty) build parameters so I can make a http webrequest to TeamCity's REST Api, something like the following:


Empty build parameters in this example (there are more, but i included only 2 for the sake of simplicity)



And the corresponding REST Url passing the parameters to TeamCity


This works, so far so good, now to the problem:


It seems I can only use basic authentication with username and password embedded in cleartext in the url. Sure, I can Setup https but still there is no way to get the users credentials in the application that makes the above http/s request.

This would be important because we want to know who started the build, if we just use a hardcoded service account for the request, the whole auditing feature TeamCity provides are useless (because every build would be run via service account).

Do I really need to authenticate to TeamCity with basic authentication or is it possible to use something like integrated authentication (like IIS).



TeamCity is Running on Windows Server 2k8, standard Tomcat Installation.


Thanks, best regards



Michael Kuzmin JetBrains 1,561 posts since
Jul 30, 2005
Currently Being Moderated
Oct 17, 2011 7:49 PM in response to: _Davis_
Re: Rest API Authentication Integrated

Hi Davis


At the moment basic authentication is the only option.

Please vote for this feature request in TW-6885.



MrClyfar Newbie 17 posts since
Nov 7, 2007
Currently Being Moderated
Jun 14, 2012 11:59 AM in response to: Michael Kuzmin
Re: Rest API Authentication Integrated

Hi there.


Since NTLM support has been added to the web UI, does this mean I can use it when making REST API calls?



Yegor Yarko JetBrains 1,901 posts since
May 5, 2004
Currently Being Moderated
Jun 25, 2012 4:38 PM in response to: MrClyfar
Re: Rest API Authentication Integrated



Yes, you should be able to use REST with NTLM authentication.

It might depend on whether your client supports the option, though.


e.g. I managed to use curl to use NTLM with a command line like:

curl -v --ntlm --user USERNAME http://teamcity:8111/app/rest/server

Eduardo Radanovitsck Newbie 1 posts since
Dec 1, 2012
Currently Being Moderated
Dec 1, 2012 10:30 PM in response to: Yegor Yarko
Re: Rest API Authentication Integrated

I tried to use NTLM for the rest API and it didn't work. But I did manage it to work using NTLM + basic Auth.


You first use NTLM in the /ntlmLogin.html page and then use the cookie that TeamCity provides to you in the API.


See with a small example on how to do this.

More Like This

  • Retrieving data ...