devopshq / tfs

Microsoft TFS API Python client
https://devopshq.github.io/tfs/
MIT License
111 stars 28 forks source link

This seems to work only with basic authentication enabled #8

Closed PeteW closed 7 years ago

PeteW commented 7 years ago

Default on-prem installations of TFS 2015/2017 dont enable basic auth. For many (myself included) requesting enabling of basic auth is a cross-departmental barrier. Suggest considering support for NTLM auth and/or the personal access token.

I dont have time to work on this (yet) but it would seem for the access token you would have something like: curl -u {username}[:{personalaccesstoken}] https://{server}:8080/DefaultCollection/_apis/projects?api-version=2.0 or adding the header: Authorization: Basic <BASE64 personalaccesstoken> According to the API docs

My particular site of interest does not have basic auth enabled however TFS-CLI does work using personal access tokens thus proving this is possible to accomplish without basic-auth.

allburov commented 7 years ago

Hello, thank you for your suggestion! For now, we can implement and test only NTLM auth, we have only 2015 Instance, it isn't support personalaccesstoken Somebody else can test this library with access token and create pull requests :) #9

# DEFAULT - Use HTTP Basic Auth
client = TFSAPI("https://tfs.tfs.ru/tfs/", user=user, password=password)

# Use NTLM authentication
from requests_ntlm import HttpNtlmAuth
client = TFSAPI("https://tfs.tfs.ru/tfs/", user=user, password=password, auth_type=HttpNtlmAuth)