Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Error: Failed Request: Unauthorized(401) #274

Closed
mtpli opened this issue Jul 4, 2017 · 13 comments
Closed

Error: Failed Request: Unauthorized(401) #274

mtpli opened this issue Jul 4, 2017 · 13 comments

Comments

@mtpli
Copy link

mtpli commented Jul 4, 2017

I‘m using the latest version 1.119.0 for visual studio team services, but when I trying to use TFVC to connect TFS, Multiple attempts to do Team: Signin end up locking my account.

debug: [10188] Error: Failed Request: Unauthorized(401) - https://***/tfs/defaultcollection/_apis/tfvc/branches

I saw the issue #59, that means Ensure Keep-Alive is true for HTTPS connections can resolve this issue, it seems the latest version already resolved this issue, but I still met the same issue.

@jeffyoung
Copy link
Contributor

Hi @5lao2.

You appear to be running into the same issue as #246. Unfortunately, it appears the issue is with the underlying library used by the extension to perform the NTLM authentication. If you're willing, I'd be interested in knowing what the results are from running the test application I provided here. You'll have to install gulp via npm and update the URL and credentials but it should help determine if it's the same issue.

@jeffyoung
Copy link
Contributor

I just released v1.122.0 that has the changes from #291 in it (which addresses the issue when using TF.exe and the client is on a different domain than the TFS server). If this is the same issue as #246, I expect it to be fixed in this release..

@hmendezm
Copy link

Hi Guys,

I am using extension version 1.122.0 and Microsoft Visual Studio Team Foundation Server Version 15.112.26301.0. I am getting the issue with [01608] Failed call with repositoryClient: Unauthorized. Check your authentication credentials and try again. Error: Error: Failed Request: Unauthorized(401) - https://...../_apis/tfvc/branches.

when I use Tf cmd line I do not have problems but when I try to team: Signin is not working and I am not able to log IN.

Any idea what is the issue? I saw "Ensure Keep-Alive" but I do not know where to set up the parameter.

Best regards
Henry

@dmumladze
Copy link

@hmendezm It's the Node module they use for NTLM auth that's causing the issue.

@tmmukunn
Copy link

tmmukunn commented Jun 6, 2018

I'm using 1.133.0 and our local 2015 TFS server running (not hosted on the Internet) and noticed the same thing with the accounts being locked out after exceeding the maximum number of bad password attempts We are using the highest LAN Manager Authentication setting: Send NTLMv2 response only. Refuse LM & NTLM.
The Node module you are using appears to not support NTLMv2. I did find another Node module that does: https://raw.githubusercontent.com/clncln1/node-ntlm-client/master/lib/ntlm.js.
The function parameters are slightly different but don't require much modification to make it work. I was able to authenticate after replacing the version of ntlm.js you provided with theirs and making sure the function signature of theirs matches the old one that is expected by VSCode/vsts.

To reproduce the problem I was having: Set the LAN Manager Authentication setting to the highest level: Send NTLMv2 response only. Refuse LM & NTLM on the client and TFS Server. Authentication attempts will result in bad password attempts using the current NTLM implementation employed by vscode/vsts.

@dmumladze
Copy link

dmumladze commented Jun 19, 2018

@tmmukunn Any way you could share the modified version?

@c1v
Copy link

c1v commented Jul 11, 2018

Same issue here.
In my case, changing the domain password to something without double-quotes solved the issue.
Seems to me like an escaping/encoding-issue?

local TFS: 16.131.27701.1 (Tfs2018.Update2)
TFVC (TF.exe, TF.cmd) version: 14.134.0.201804261732
VSTS: 1.136.0

@Nehmiabm
Copy link

What's the status on this issue? How do we fix it for the NTLMv2 incompatibility with vscode? I can't sign in because of this on vscode I'm forced to use visual studio

@jlmcabral
Copy link

I also have the same issue. I'm using Azure Repos v1.144.1 and VSCode 1.31.1

@imaa
Copy link

imaa commented Mar 1, 2019

V 2.5
Same ISSUE HERE
2019-03-01T06:37:30.581Z - debug: [22220] RemoteUrl = http://server/tfs/defaultcollection
2019-03-01T06:37:30.581Z - debug: [22220] Getting repository information for a TFVC repository at http://server/tfs/defaultcollection
2019-03-01T06:37:30.582Z - debug: [22220] Parsing values from repositoryInfo as string url
2019-03-01T06:37:30.583Z - debug: [22220] Starting the validation of the collection. Url: 'http://server/tfs/defaultcollection'
2019-03-01T06:37:30.678Z - error: [22220] Failed call with repositoryClient: Unauthorized. Check your authentication credentials and try again. Error: Error: Failed Request: Unauthorized(401) - http://server/tfs/defaultcollection/_apis/tfvc/branches
2019-03-01T06:37:30.679Z - debug: [22220] Error: Failed Request: Unauthorized(401) - http://serfer/tfs/defaultcollection/_apis/tfvc/branches

@lgp1985
Copy link

lgp1985 commented Jul 3, 2019

I receive the same issues on the log, I'm using smart card, so I can't honestly know my end password, only the PIN for the smartcard.

So what should be provided as "usedefaultcredentials", when using powershell I need to set this way.

2019-07-03T19:47:14.794Z - debug: [23124] Starting sign in process
2019-07-03T19:47:15.518Z - info: [23124] Signin: Username and Password provided as authentication.
2019-07-03T19:47:15.518Z - debug: [23124] Could not parse repository url: undefined
2019-07-03T19:47:16.125Z - debug: [23124] Reinitializing after successfully storing credentials for Team Foundation Server.
2019-07-03T19:47:16.126Z - debug: [23124] Polling interval value (minutes): 5
2019-07-03T19:47:16.126Z - debug: [23124] Polling interval must be greater than 10 minutes.
2019-07-03T19:47:16.130Z - info: [23124] *** FOLDER: d:\DEV\ ***
2019-07-03T19:47:16.130Z - info: [23124] AzureReposVSCode/1.149.2 (VSCode 1.36.0; Windows_NT 10.0.17763; Node 10.11.0)
2019-07-03T19:47:16.131Z - debug: [23124] Looking for an External Context at d:\DEV\tfs\ITSMP\CopyBack
2019-07-03T19:47:16.131Z - debug: [23124] Found an External Context at d:\DEV\tfs\ITSMP\CopyBack
2019-07-03T19:47:16.132Z - debug: [23124] Parsing values from repositoryInfo as string url
2019-07-03T19:47:16.132Z - debug: [23124] Could not parse repository url: undefined
2019-07-03T19:47:16.333Z - debug: [23124] Started ApplicationInsights telemetry
2019-07-03T19:47:16.333Z - info: [23124] Getting repository information with repositoryInfoClient
2019-07-03T19:47:16.333Z - debug: [23124] RemoteUrl = https://server/tfs/APPS1/
2019-07-03T19:47:16.333Z - debug: [23124] Getting repository information for a TFVC repository at https://server/tfs/APPS1/
2019-07-03T19:47:16.333Z - debug: [23124] Parsing values from repositoryInfo as string url
2019-07-03T19:47:16.334Z - debug: [23124] Starting the validation of the collection. Url: 'https://server/tfs/APPS1/'
2019-07-03T19:47:17.658Z - error: [23124] Failed call with repositoryClient: Unauthorized. Check your authentication credentials and try again. Error: Error: Failed Request: Unauthorized(401) - https://server/tfs/APPS1/_apis/tfvc/branches
2019-07-03T19:47:17.658Z - debug: [23124] Error: Failed Request: Unauthorized(401) - https://server/tfs/APPS1/_apis/tfvc/branches

@BinarySpike
Copy link

I believe this issue is affecting me in Azure Repos 1.161.0 with VSCode 1.43.0.

I get "Unauthorized" at the bottom when I try to "Team: Signin"

My PC is in a different domain than our TFS server. When I attempt to Sign-in with a username from the same domain as our TFS server, I get "No team project found for this repository. Build and Work Item functionality has been disabled."—Because the same-domain account I'm using doesn't have much-if-any access to TFS.

@FrederickBizzardo
Copy link

I got the same message until I followed @BinarySpike 's advice. And it worked. Thanks a lot @BinarySpike

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

Successfully merging a pull request may close this issue.