A sample/proof of concept plugin for HTTP-based TeamCity authentication. WARNING 1: The plugin uses closed API available since TeamCity 7.1 which will most probably change in TeamCity 8.0 WARNING 2: The plugin is not meant to meet high security requirements. Plugin is provided on "No guarantees, use at your own risk" terms. Authenticates each not yet authenticated request with parameters alternativeLoginUser=&alternativeLoginToken= as the user supplied, provided the supplied token is one of the following: - automatically generated and printed into teamcity-server.log on the server start (search for "Authentication token for alternative user login" log message) or set to fixed value in internal.properties file via "alternativeLoginToken" internal property. - one saved in user property "alternativeLoginToken" for the user specified (can set the property via REST: "curl -v --request PUT "http://ADMIN_USER:PASSWORD@TEAMCITY_URL/httpAuth/app/rest/users/USERNAME/properties/alternativeLoginToken" --header "Content-Type: text/plain" --data "TOKEN") Instead of parameters, the request can have "alternativeLoginUser" and "alternativeLoginToken" HTTP request headers. Add internal property "alternativeLogin.createUsers=true" to create a new user if it does not exist and correct token is supplied. Make sure all used tokens are secure enough to eliminate possibility of bruteforcing. -- How to use and build the project -- Pre-requisites: - JDK 1.6 - IntelliJ IDEA (12+, Ultimate edition recommended) - Ant 1.7+ - TeamCity 7.1+ .tar.gz distribution The project is compatible with IntelliJ IDEA 12+ and TeamCity 7.1+ Sequence of IDEA setup: - configure Path Variable "TeamCityDistribution" in IDEA Settings/Project Variables to point to the unpacked TeamCity .tar.gz distribution. Use the minimum version the plugin should be compatible with. - configure Path Variable "TeamCityDataDirectory" in IDEA Settings/Project Variables to point to the data directory to be used. - open the project (please make sure to configure path variables before first project opening) - configure Project SDK the in "Project Structure"/Project to point to JDK 1.6 or greater (minimum JDK version applicable for TeamCity server and agent is recommended) - (IntelliJ IDEA Ultimate only) configure Application server in "Run TeamCity server with plugin" run configuration to point to the TeamCity distribution - (optional) consider changing code style to have 2 spaces tabs and indents (IntelliJ IDEA Ultimate only) To run the TeamCity server with the plugin deployed from IDEA run "Run TeamCity server with plugin" run configuration To build with Ant: - edit build.properties to configure path TeamCity Data Directory - edit build.properties to configure path to TeamCity distribution and path to TeamCity Data Directory - after any project structure changes (e.g. deleting or adding a module) make sure you invoke "Generate Ant Build" in IDEA with the only options selected: single file, Enable UI forms