idlemind
idlemind

Reputation: 686

Where is ServiceIdentityCredentialsProvider in VS 2012?

This article talks about using a class called ServiceIdentityCredentialsProvider from Microsoft.TeamFoundation.Client.dll which would seem to allow Service Account credentials to be used to programmatically connect to Team Foundation Service (the cloud hosted service). The alternative is TeamProjectPicker, which will prompt for credentials, but I need my code to run non-interactively.

This is the stub of what I'm try to do:

var teamProjectCollection = new TfsTeamProjectCollection(new Uri(CollectionUrl), new ServiceIdentityCredentialsProvider(username, password));
teamProjectCollection.Authenticate();

Where username and password are the service account details obtained using the method described in the article. Does anyone have any ideas on what this class may have been renamed to/an alternative way of doing this?

Upvotes: 1

Views: 365

Answers (1)

idlemind
idlemind

Reputation: 686

Apparently the correct way to do this with Visual Studio 2012 is:

return new TfsTeamProjectCollection(new Uri("https://example.visualstudio.com"), new TfsClientCredentials(new SimpleWebTokenCredential("username", "password")));

Upvotes: 1

Related Questions