public TFSAccess(string tfsUri, string username = null, string password = null)
{
TfsTeamProjectCollection tfs;
if (username != null && username != string.Empty)
{
FederatedCredential credential = new SimpleWebTokenCredential(username, password);
TfsClientCredentials clientCredentials = new TfsClientCredentials(credential);
tfs = new TfsTeamProjectCollection(new Uri(tfsUri), clientCredentials);
}
else
{
tfs = new TfsTeamProjectCollection(new Uri(tfsUri));
}
store = (WorkItemStore)tfs.GetService(typeof(WorkItemStore));
}
I am using the above code. Both loops works fine. I just wanted to ensure that this will work fine in production server. Do I need to add ensureAuthenticated(). Please comment on it.