在我的Azure Web App中,我想通过使用他们的ClaimsIdentity来模拟用户来调用第三方API。第三方Web API允许使用基本或Kerberos,如果需要,我可以选择切换到使用Windows集成安全性的第三方SDK。Azure Web App Web API模仿使用ClaimsIdentity的用户
我遇到的问题是模拟位,下面是我的代码,因为它是。
var webUser = HttpContext.Current.User.Identity as ClaimsIdentity;
var windowsIdentity = S4UClient.UpnLogon(webUser.Claims.FirstOrDefault(x => x.Type.Equals(ClaimTypes.Upn)).Value);
using (var impersonationContext = windowsIdentity.Impersonate())
{
//make call to 3rd party Web API or SDK
}
当运行上面我得到以下错误:
The pipe endpoint 'net.pipe://localhost/s4u/022694f3-9fbd-422b-b4b2-312e25dae2a2' could not be found on your local machine.
一切我读过点启动C2WTS Windows服务,有没有开始为Azure的web应用程序这种服务方式?如果不是,我该如何去冒充用户或将凭据传递给我的第三方api/sdk?
这可以在云服务Web角色中完成吗? – Alan