0

I've got a .NET-Webservice written in C# which uses Windows-Authentification. So when I'm connecting to my webservice to use a webmethod, I'm getting the login-form first, where I can write my username and password. This authentification works correctly but now, I want to use THAT authentification to login to the Team Foundation Server (Yes they are the same). Is there any possibility to use the windows-credentials or the authentification in my C#-Code to forward them to the TfsTeamProjectCollection-object?

That's how I connect for now:

NetworkCredential credentials = new NetworkCredential(tfsUsername, password);
TfsTeamProjectCollection tfs = new TfsTeamProjectCollection(new Uri(tfsURL), credentials);
tfs.Authenticate();

So now, I want to use somehow my windows-authentification to forward them to the constructor of the TfsTeamProjectCollection, instead of using my NetworkCredential credentials object.

Any information about that would be very nice. Thanks :)

  • Check Kerberos delegation materials from Microsoft TechNet. – Lex Li Sep 07 '16 at 02:26
  • Possible duplicate of [Can we impersonate Windows user to TFS or TFS web access?](http://stackoverflow.com/questions/15318497/can-we-impersonate-windows-user-to-tfs-or-tfs-web-access) – nschonni Sep 07 '16 at 12:58

1 Answers1

0

You may check the reply from @MrHinsh in this case Access TFS via its API using Windows Authentication:

You have two options to resolve it:

  1. Host your mvc web app on the same server as tfs
  2. Configure Active Directory to allow your servers identity to delegate the logged in user credentials to another service.
Community
  • 1
  • 1
Cece Dong - MSFT
  • 29,631
  • 1
  • 24
  • 39