【发布时间】:2011-12-13 14:59:37
【问题描述】:
我有一个使用 Windows 身份验证的带有 WCF 服务的 Silverlight 应用程序。 我的用户得到了正确的身份验证。我可以在客户端访问他们的用户名和角色。 但是我如何在服务器端做同样的事情呢? 这个我试过了
ServiceSecurityContext.Current.WindowsIdentity
和
IIdentity caller = ServiceSecurityContext.Current.PrimaryIdentity;
这是我在 stackoverflow 上找到的类似问题的答案,但无法编译。 我得到一个“ServiceSecurityContext 不包含 Current 的定义”异常。
那么如何在服务器端获取用户呢?
【问题讨论】:
标签: c# wcf silverlight wcf-ria-services windows-authentication