2011-12-21 144 views
0

我从ASP.NET应用程序调用WCF服务。由此,我正在使用WSHTTPBinding访问WCF服务。我可以从HttpContext.Current.User.Identity.Name获得当前用户。我希望能够将此传递给WCF(不使用客户头 - 当然有一个正确的方法来执行此操作。)它必须是HttpContext.Current.User.Identity.Name中的身份而不是WindowsIdentity.GetCurrent().Name,因为此服务可能会从ASP中消耗。 nET使用Forms或Windows身份验证的应用程序。据我所知,它应该出现在ServiceSecurityContext.Current.PrimaryIdentity.Name。我寻找年龄寻找答案,但还没有找到它。WCF身份验证流程

回答