Passthrough (impersonation) authentication with ASP.NET and TFS api

送分小仙女□ 提交于 2019-11-28 00:12:20

Solution 1

This is the delegation method. As Paul points out it's a single setting in your active directory:

  1. Find the IIS server in the computers node of the "Active Directory users and Computers" console.
  2. Click on the delegation tab, and select the second option:

  3. Create a 'Cache' directory in your IIS root folder

  4. Add the following to your web.config:

<appSettings>
<add key="WorkItemTrackingCacheRoot" value="C:\path-to-web-root\Cache\"/>
</appSettings>

  1. Make sure your web.config contains:

<system.web>
<identity impersonate="true" />
</system.web>

  1. Turn on Windows authentication and impersatonation and disable everything else in IIS authentication:

Solution 2

Another solution to avoid the steps above is to simply run your application under the TFS:8080 site, as a new application. The hop issue is then removed as you are running in the same context as the web service that your app is calling.

  • Create a new app pool, use network identity.
  • Make sure your application has anonymous authentication turned off
  • Make sure it has windows authentication turned on.
  • Add <identity impersonate="true" /> to the web config.

I wonder if you're hitting the old Double-Hop issue here?

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!