devopshq / teamcity

dohq-teamcity is a Python package providing access to the JetBrains TeamCity server API.
https://devopshq.github.io/teamcity/
MIT License
33 stars 12 forks source link

How do you login using token instead of user/password? #43

Closed richard-nilsson closed 2 years ago

richard-nilsson commented 2 years ago

Hi,

All examples on dohq TeamCity use user/password as authentication. Unfortunately, the organization I am in right now only use smart card and I have to use token based authentication. I read the api_client.py file that is part of the package, but I can't really make out how to set the token. Using standard header, you need to set "Bearer " (like curl --header "Authorization: Bearer "), but I can't see how this is done with: tc = TeamCity(url, auth=(user, passwd))

Any help would be greatly appriciated.

Thanks in Advance, Richard

richard-nilsson commented 2 years ago

Sorry. Didn't see https://github.com/devopshq/teamcity/issues/23 until I already submitted it. I will try the suggestion.