- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
ServiceSecurityContext 为何包含 WindowsIdentity 属性?
即,如果用户使用 Windows 身份验证机制进行身份验证,则 ServiceSecurityContext.PrimaryIdentity 和 ServiceSecurityContext.WindowsIdentity 属性包含完全相同的信息,如果用户使用身份验证某些其他身份验证机制,然后 ServiceSecurityContext.WindowsIdentity 将持有空白身份。
因此,在第一种情况下,WindowsIdentity 属性持有与 PrimaryIdentity 相同的数据,而在第二种情况下,它根本不持有任何数据(即它持有空白身份)。
谢谢
最佳答案
Namely, if user is authenticated using windows authentication mechanism, then both ServiceSecurityContext.PrimaryIdentity and ServiceSecurityContext.WindowsIdentity properties hold exactly the same information
完全错了。
ServiceSecurityContext.WindowsIdentity
返回类型 WindowsIdentity
,ServiceSecurity.PrimaryIdentity
返回类型 IIdentity
。 WindowsIdentity
类型具有比 IIdentity
更多的属性,如果需要,可以帮助您更深入地了解访问权限、声明、 token 和已验证身份用户。
特别是 token 可以帮助您模拟用户,从而获得对特权资源的访问权限。
关于wcf - ServiceSecurityContext.WindowsIdentity 的用途?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4370347/
我正在尝试检查Powerhell脚本是否以管理员身份运行。 在网上搜索后,我得到了一些运行良好的示例代码。 为了获得WindowsPrincipal对象,我发现了以下两个示例代码。 第一: New-O
我正在尝试使用 SID-s 检查用户是否属于某些组。 我正在使用 WindowsIdentity.Groups ,但后来注意到有时它不显示用户属于管理员组。 搜索了一段时间后,我发现不是Windows
我试图拦截 WindowsAuthenticationModule 以另一个用户身份登录到应用程序,但我无法在不知道他的密码的情况下创建新的 WindowsIdentity。该代码将在管理员权限下运行
我正在开发具有以下详细信息的客户端服务器应用程序: Client(C++) -----------HTTPS--- Server (C#/WCF) 服务器: 与 Windows Active
当我像这样使用 WindowsIdentity 模拟时: WindowsIdentity newId = null; WindowsImpersonationContext impe
我正在构建一个站点,该站点使用当前用户的 WindowsIdentity 获取用户信息。我从中获得的主要信息是 ssid。 我按如下方式为当前用户执行此操作 IntPtr logonToken = W
ServiceSecurityContext 为何包含 WindowsIdentity 属性? 即,如果用户使用 Windows 身份验证机制进行身份验证,则 ServiceSecurityConte
获取当前用户的用户名和/或 SID 时,首选方法是什么? 是否使用: WindowsIdentity.GetCurrent().Owner 或者: WindowsIdentity.GetCurrent
我正在尝试在我的 WPF 客户端/服务器 (WCF) 应用程序中使用 Windows Identity Foundation 进行授权,该应用程序可能会或可能不会在与提供身份验证的事件目录相同的信任环
我正在一个安全的服务器上运行一个应用程序(我必须远程访问并且必须通过电子邮件将文件发送给某人以便他们将它们放到服务器上,因此更改代码不是一个快速的过程)。 在某一时刻,该服务通过获取登录用户 Oper
我有一个由 IIS 托管的 Web 应用程序。它配置了表单例份验证和匿名身份验证,并且启用了模拟。应用程序池帐户是网络服务。匿名帐户是 Costa。 Costa 可以访问数据库。 NetworkSer
假设我有一个 WindowsIdentity 的实例,并且想要获取它所属的组。我使用以下代码获取列表: WindowsIdentity identity = null; // get iden
我正在使用模拟在连接到域的 Windows 7 计算机上实例化 WindowsIdentity。我通过 Groups 属性取回了很多组。一些域、本地和内置但我没有得到用户所在的内置管理员组。我很困惑为
我正在使用 WindowsIdentity 获取当前用户的 ID 以执行 SSO。在大多数情况下,我得到的正是我想要的,但对于某些用户来说,我得到的结果很奇怪。示例代码: IIdentity WinI
TL;DR WindowsIdentity 的 Token 属性中是否包含用户 token (例如,someIdentity.Token) 被欺骗: var validated = new Windo
我有以下代码: var baseUrl = "https://" + GetIdentityProviderHost(environment) + "/oauth2/authorize"; var q
我正在使用 Windows 身份验证的 ASP.NET 应用程序中。 我正在使用 HttpContext.Current.User.Identity.Name 获取当前经过身份验证的用户的用户名,这会
我有一个安装项目(在 Windows 7 上运行)在提交时启动自定义操作,启动刚刚安装的应用程序。在此应用程序启动期间,我有一个方法可以检查当前用户名以执行某些身份验证。当从此自定义操作启动时,我得到
如何从收到的msmq消息中获取发件人的WindowsIdentity? 我使用 msmq 作为传输和安全应用程序 block ,并使用授权规则提供程序进行操作授权。我需要 WindowsPrincip
我有一个 ASP.NET 网站,它要求我的应用程序池是经典 .Net 应用程序池。该站点在 IIS 7 上的 .NET 3.5 上运行。当我尝试获取已登录用户的 Active Directory 用户
我是一名优秀的程序员,十分优秀!