1
votes

I have created a PAT token for my user account in TFS Server 2017 (on-premises, not VSTS). Using Postman I am attempting to call the following REST API with Basic Auth:

GET http://{server:port}/tfs/DefaultCollection/_apis/projects?api-version=1.0

In response I get the following error:

TF401444: Please sign-in at least once as {Well Known SID for my user account} in a web browser to enable access to the service. - Microsoft Team Foundation Server

I have tried opening the same URL in Chrome and attempting to login with the PAT but with no success (the login is not completed). Any suggestions as to what I am missing here?

TFS seems to be recognising the PAT token as I receive a different error if I revoke it.

1
Can you succeed to login the web portal? If so, try creating a new full-scope pat and test that again. Also, if you're administrator user, you can try Reapply the user as Administration Console User in TFS Administration Console. option.LoLance
Hi Lance, thanks for the response - I have now resolved this, I will add an answer explaining what was amiss.Adam

1 Answers

0
votes

The issue here was the use of 'DefaultCollection' in the URI. I didn't have permissions on the default project collection in our TFS instance and needed to replace 'DefaultCollection' with the name of the collection I actually did have access to.

It seems obvious now, but the documentation didn't make it clear that this was a variable part of the URI so I had assumed the API was always hosted as part of the DefaultCollection.