0

In my place of work we have our own azure devops server for source control I've written a C# application that interacts with it using REST calls with the HttpClient class Everything works fine but at the moment I have to use a personal access token for my API calls to work

I couldn't find any other solution that I can implement (or at least that I understand HOW to implement) other than that as I don't have administrator privileges on that server

I was wondering... How is it that when I make GET calls from my internet explorer and get the json response but I can't implement the same behavior in my C# HtppClient calls?

Is it possible to use my windows credentials as authentication to the azure devops REST API?

1 Answer 1

0

It seems the solution was quite simple I added UseDefaultCredentials to the constructor of HttpClient like that:

            client = new HttpClient(new HttpClientHandler() { UseDefaultCredentials = true }); ;

and that actually works! All my REST calls work without using PAT at all

Sign up to request clarification or add additional context in comments.

1 Comment

Hello @AshChlor, even I am facing same issue and trying to access Azure devops API using current login user, and even after using above code i get error as "Non-Authoritative Information". Can you please update with more detail code you have used.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.