• Register
0 votes

Problem :

We upgraded to TFS 2017 and our API calls stopped working and we started receiving following error:
"TF400813: Resource not available for anonymous access. Client authentication required.". Anything in [] brackets was replaced.

I amt don’t know why the code block is having issues.

using (var myclient = new HttpClient(new HttpClientHandler()))
myclient.Timeout = TimeSpan.FromMinutes(3);
myclient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic",
myclient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
HttpResponseMessage myresponse = myclient.GetAsync($"https://[server]:8080/tfs/[node]/[node]/_apis/build/builds?api-version=2.0&definitions={buildDefinitionNumber}&resultFilter={resultFilter}&$top={maxBuildCount}").Result;
var myresult = myresponse.Content.ReadAsStringAsync().Result;
return (JArray)JObject.Parse(myresult)["value"];
6 5 3
7,540 points

Please log in or register to answer this question.

1 Answer

0 votes

Solution :

As a solution on yhe issue, I just created a personal access token (PAT) and I was able to get authenticated using that PAT.

This is not the ideal way as I am putting my personal access token in the code to get this working. I was using the service account so now I am trying to understand that how can I create a PAT for the service account and/or I am still trying to figure out a way to make it work like it once did because I can not login to the TFS dashboard with the service account.

Please refer the following Updated Code:

string mycredentials = Convert.ToBase64String(System.Text.ASCIIEncoding.ASCII.GetBytes(string.Format("{0}:{1}", "", "<PAT>")));
myclient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", mycredentials);


Further Readings :

I refered below articles:




9 7 4
38,600 points

Related questions

1 vote
1 answer 23 views
Problem: trying to use spring-security-oauth2.0 with Java based configuration. full authentication is required to access this resource
asked Feb 24 Sofia Castro 4.2k points
0 votes
1 answer 8 views
Problem: I am struggling to get a SQL Server connection from machine A to machine B which is running the SQL Server. I would be happy to generate more debug info, just tell me what you need.
asked Mar 20 ummesalma 22k points
0 votes
1 answer 2 views
Problem: I'm having trouble finding a solution; could you please assist me? The http request was forbidden with client authentication scheme 'anonymous'.
asked 5 days ago tuhin1 46.8k points
0 votes
1 answer 462 views
Problem : I have created one of the WCF service and deployed it on the Server. When I browse this service it gives me positive response with the wsdl URL. Now I am trying to test my service through the WCF Test client. It shows me ... factory) The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from the server was 'Negotiate,NTLM'.
asked Jan 23, 2020 jwilliam 3.9k points
0 votes
1 answer 9 views
Problem: Please help me &hellip; how can I solve this that client was not authenticated to send anonymous mail during mail from?
asked Mar 18 Ifra 24.4k points
0 votes
1 answer 290 views
Problem : I want to send mails using my web application. But my below code is showing me the below error: The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.7.57 SMTP; Client was not authenticated to send ... false; mysmtp.Timeout = 600000; } // Passing values to smtp object mysmtp.Send(myfromAddress, mytoAddress, mysubject, mybody); } } }
asked Dec 9, 2019 alecxe 7.5k points
0 votes
1 answer 196 views
Problem : I am very new to node.js and MySQL and I have just started setting up and also trying out some basic code. But, I am unable to make even the simple connection to a server for some reason. I have also installed a newest MySQL ... ; console.log("Connected!"); }); My Error: &ldquo;Client does not support authentication protocol requested by server consider upgrading mysql client&rdquo;
asked Jan 30, 2020 jwilliam 3.9k points
0 votes
1 answer 3 views
Problem: Please help me &hellip; how to deal with this that required privilege is not held by the client windows 10?
asked Mar 18 Ifra 24.4k points
1 vote
1 answer 3 views
Problem: I&rsquo;m getting an error while running my eclipse project on tomcat server: HTTP Status 404 - The requested resource (/ProjectName/) is not available. Nothing is missing in my files , I have Index.jsp in the /WebContent folder and my web.xml contains below ... <welcome-file>index.jsp</welcome-file> </welcome-file-list> I&rsquo;m not missing any file then why am I getting this error?
asked Apr 3 Ashty 5.7k points