-
Notifications
You must be signed in to change notification settings - Fork 451
Can't sign in to on-prem TFS #246
Comments
Hi @mrichman. Thanks for trying out the extension. Unfortunately, I think the difference here is that your web browser is going to use integrated NTLM authentication against the server (Windows, which I presume you're using, will just use the credentials you used to log into your machine when it makes the web request; let me know if you're not on Windows). The VS Code extension has to rely on the vsts-node-api which provides the NTLM support (which is interactive; that is, it requires a user name and password and it contains the code to do the NTLM negotiation itself... it can't rely on the Windows networking stack that's been around for years). I added the NTLM support to vsts-node-api but it's likely that won't support all scenarios (we've had other reports as well). Do you have any other details on how your network is set up? For instance, do you know if your TFS server is on the same domain as your account (which appears to be CMC)? Any other differences you might be aware of? Since I assume you've entered the same credentials as you did when you logged into your machine, there's something going sideways during the negotiation during the HTTP call that results in the 401. At this point, however, I don't know what that would be. |
Hey @jeffyoung Yes, I'm using Windows 10 connected to the same domain (CMC) that my TFS server is in. Short of putting Wireshark on here and sniffing the HTTP, I'm not sure what else to look at. Thanks, |
Using 1.119.0, same issue:
|
If this is helpful, here are some headers I dumped using Wireshark:
|
Hi @mrichman, thanks for that information. Based on what I see (if I'm reading it correctly), it appears (bottom to top) to be a 'typical' NTLM challenge-response flow. I'm at a bit of a loss as to what's going sideways here. That said, I'm attaching a node project that you can open in VS Code, set the server URL, your username, domain and password in the code, hit F5 and see if the connection works. This code was the basis |
I set my TFS host and credentials in
If this is helpful at all, running
|
Thanks Mark. Unfortunately, the code I sent was the simplest repro I could come up with. Had it worked, I'd have a bit more information about what to investigate next. But since it and If you have any other ideas on what we could investigate, I'd be interested in knowing what those are. But at this point, I don't know what to look at next. |
I tried omitting |
Fixes issue microsoft#246. In Windows domain credentials are not included by the argument builder
I think this may be the same issue that I've just submitted a pull request for. My dev VM (windows10) is in a different domain to my TFS server. I noticed authentication errors occurring and did some digging. I found that the domain portion of my username (domain\user) was not being passed. I determined this by commenting out the arg = "******" line in the argument builder, so I could log the full credentials that were being passed. The argument builder was not including the domain when building the tf.exe command. |
Fixes issue #246. In Windows domain credentials are not included by the argument builder
v1.122.0 has been released with these changes (#291). Thanks again for the PR @dfrencham. |
I'm using on-prem TFS along with the latest v1.122.0 plugin, but still experiencing the same error. |
@dmumladze what are your log entries showing? |
Error is at I can access the URL |
Same here: using latest version: 1.122.0. Trying to access Team Foundation Server 2017 (15.117.27024.0): What I find weird is the user name value in Windows Credential Manager, it says: creds.exe |
@catqbat , so it should be. Tfvc extension uses external tool "creds.exe" to save user credentials into the credentials manager on windows. |
Ok, good to know. |
One way to tackle this would be to download the source for vsts-vscode, search for "-noprompt". That will lead you to the file where your credentials are masked for display in the log window. Comment out the code block that does the masking, then load the plugin. This will allow you to see the credentials being sent by vsts-vscode in the Output window (change the drop down to TFVC). That is how I was able to diagnose my authentication issues. |
At this point it's probably worth installing a rest client (such as this one for Chrome: https://chrome.google.com/webstore/detail/yet-another-rest-client/ehafadccdcdedbhcbddihehiodgcddpl). Try making a rest request to https://tfs.hostname.net/tfs/collection/_apis/tfvc/branches (ensure you've set credentials in your rest client). That should help narrow down the cause. |
@dfrencham - thank you very much for your assistance. I've checked out this rest client, but I'm now a little confused. If I enter my credentials in form domain\user_name + pass and hit "send request" button, there's a chrome popup prompt from tfs saying "authorization required" with input fields for user name and pass. If I enter my credentials in chrome popup - nothing happens and the popup reappears with empty input fields :) |
Hi guys, I have exactly the same issue. I've checked with Fiddler and I'm getting 401 Unauthorized but when I hit the url in the browser it works. I am using v1.144.1 (2018-11-05) of Azure Repos extensions. |
I also have begun to experience this as well in last 4 weeks. Command line git is working fine. Latest VS Code 1.31.1 |
Multiple attempts to do
Team: Signin
end up locking my account.I can browse directly to the URL which returns 401 in the log:
The text was updated successfully, but these errors were encountered: