use*_*207 18 wcf
如何HttpContext.Current.User.Username从WCF服务中的Web应用程序进行访问?
HttpContext.Current.User.Username
blo*_*art 33
通常你不这样做 - HttpContext是一个ASP.NET概念,除非你在启用ASP.NET兼容性的情况下运行它,否则不适用于WCF.
如果您希望当前用户在WCF中,则ServiceSecurityContext.Current.PrimaryIdentity通过OperationContext使用或获取安全上下文.
ServiceSecurityContext.Current.PrimaryIdentity
归档时间:
14 年,6 月 前
查看次数:
17701 次
最近记录:
9 年,1 月 前