Chr*_*s S 6 asp.net impersonation tfs tfs-sdk
我正在尝试在使用TFS2010 API的ASP.NET网站中启用passthrough或模拟身份验证.
我已经使用Cassini正常工作,但是在IIS 7.5(Windows 7)中出现了问题.
我发现了关于这个主题的博客文章,并尝试了以下内容:
private static void Test()
{
TfsTeamProjectCollection baseUserTpcConnection =
new TfsTeamProjectCollection(new Uri(Settings.TfsServer));
// Fails as 'baseUserTpcConnection' isn't authenticated
IIdentityManagementService ims =
baseUserTpcConnection.GetService<IIdentityManagementService>();
// Read out the identity of the user we want to impersonate
TeamFoundationIdentity identity = ims.ReadIdentity(
IdentitySearchFactor.AccountName,
HttpContext.Current.User.Identity.Name,
MembershipQuery.None,
ReadIdentityOptions.None);
TfsTeamProjectCollection impersonatedTpcConnection = new
TfsTeamProjectCollection(new Uri(Settings.TfsServer),
identity.Descriptor);
}
Run Code Online (Sandbox Code Playgroud)
当我使用卡西尼时,除此之外不需要任何东西
collection = new TfsTeamProjectCollection(new Uri(server));
我已启用web.config设置(并安装了Windows Auth模块):
<authentication mode="Windows"/>
<identity impersonate="true" />
Run Code Online (Sandbox Code Playgroud)
有什么明显的东西我错过了吗?
这是委托方法.正如Paul所指出的,它是您的活动目录中的一个设置:
单击委托选项卡,然后选择第二个选项:

在IIS根文件夹中创建"缓存"目录
<appSettings>
<add key="WorkItemTrackingCacheRoot" value="C:\path-to-web-root\Cache\"/>
</appSettings>
<system.web>
<identity impersonate="true" />
</system.web>

避免上述步骤的另一个解决方案是在TFS:8080站点下运行您的应用程序,作为新的应用程序.然后,当您在与应用程序调用的Web服务相同的上下文中运行时,将删除跃点问题.
<identity impersonate="true" />到Web配置.| 归档时间: |
|
| 查看次数: |
10064 次 |
| 最近记录: |