Slow user authentication using TeamFoundationServerFactory

Slow user authentication using TeamFoundationServerFactory

乞讨 发布于 2021-11-25 字数 767 浏览 633 回复 2 原文

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 ?

如果你对这篇文章有疑问,欢迎到本站 社区 发帖提问或使用手Q扫描下方二维码加群参与讨论,获取更多帮助。

扫码加入群聊

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

拒绝两难 2022-06-07 2 楼

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.

待"谢繁草 2022-06-07 1 楼

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