Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Authenticating on TFS 2010

Tags:

tfs

I'm having trouble authenticating as a specific user on MS Team Foundation Server. In older versions it would look like:

teamFoundationCredential = new System.Net.NetworkCredential("<USERNAME>", "<PASSWORD>", "<DOMAIN>");

TeamFoundationServer tfs = new TeamFoundationServer("http://mars:8080/", teamFoundationCredential);

Can some one tell me the equivilent for the 2010 version. So far I have:

ICredentialsProvider cred = null;

tfs = TfsTeamProjectCollectionFactory.GetTeamProjectCollection(new Uri("http://asebeast.cpsc.ucalgar.ca:8080/tfs/DefualtCollection"));

tfs.EnsureAuthenticated();

Thanks

like image 713
Keynan Avatar asked May 13 '10 19:05

Keynan


1 Answers

For TFS 2010, use the following:

TfsTeamProjectCollection collection = new TfsTeamProjectCollection(
        new Uri("http://asebeast.cpsc.ucalgar.ca:8080/tfs/DefaultCollection",
        new System.Net.NetworkCredential("domain_name\\user_name", "pwd"));
collection.EnsureAuthenticated();
like image 65
DmytroL Avatar answered Nov 08 '22 00:11

DmytroL