KhlavKalash
KhlavKalash

Reputation:

Slow user authentication using TeamFoundationServerFactory

I'm writing a time registration web project where users are able to write time related to TFS Work Items. This involves searching for a Work Item Id and displaying information about the Work item in the web, e.g. description.

This project is working properly but I'm getting complaints about the website being slow when user is accessing TFS for the first time.

I'm using Kerberos to send the user credentials over to the TFS server for authentication using the following code:

TeamFoundationServerFactory.GetServer(url);
_tfs.EnsureAuthenticated(); //Authenticates only if neccessary

This takes about 10 seconds for the first time, but after that it's working OK. Is there anything I can do to optimize this ?

Upvotes: 2

Views: 310

Answers (2)

Nick Berardi
Nick Berardi

Reputation: 54854

Not really, you will experience the same lag on your development machine the first time you open TFS.

Upvotes: 1

JaredPar
JaredPar

Reputation: 754803

Nothing comes immediately to mind. You're using the appropriate APIs and method of authentication so there is nothing you can change in your code to speed this process up.

You may want to do some investigation on the server though as to why this is taking so long. The active directory authentication should not take 10 seconds. There must be another consequential action which is taking up so much time.

I would break out a profiler and use that to determine exactly where the time is being spent. Then you can try and figure out a way to speed up that area.

Upvotes: 0

Related Questions