Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't find a way to authenticate using token vs username/password #23

Open
droopy4096 opened this issue Mar 5, 2020 · 5 comments
Open

Comments

@droopy4096
Copy link

I've tried several ways of using auth token:

tc=TeamCity('https://tc.my.com',auth=tc_token) 

and

tc.set_default_header(header_name='Authorization', header_value='Bearer {token}'.format(token=tc_token)) 

all unsuccessful with HTTP 404 error. HTTP response body: Invalid authentication request or authentication scheme is not supported

@allburov
Copy link
Member

allburov commented Mar 8, 2020

@vasokot could you please test the above example with our teamcity instance?

@allburov
Copy link
Member

allburov commented Mar 8, 2020

@droopy4096 Does it work with user password pair? If answer is yes you probably should try use auth=(username, token), i.e. change your password to your token.

@j-krauz
Copy link

j-krauz commented Jun 1, 2020

Hi, I have the same problem. I can't use user+password pair since our Teamcity server is linked to a SAML Identity Provider and the basic authentication is disabled. The only option is authentication tokens.

I tried a few things but couldn't make it work. I noticed there are token-related variables in the Configuration class so I tried the following

config = Configuration()
config.api_key = {'test': '<token>'}
config.api_key_prefix = {'test': 'Bearer'}
tc = TeamCity("<teamcity-url>", auth=None, configuration=config)

but still no luck.

@allburov
Copy link
Member

allburov commented Jun 2, 2020

@vasokot could one of our DevOps-team look at the issue?

@martwana
Copy link
Contributor

Unsure if this is still active, but I've fixed this in #29

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants