gpt4 book ai didi

wcf - ServiceSecurityContext.WindowsIdentity 的用途?

转载 作者:行者123 更新时间:2023-12-04 18:22:24 27 4
gpt4 key购买 nike

ServiceSecurityContext 为何包含 WindowsIdentity 属性?

即,如果用户使用 Windows 身份验证机制进行身份验证,则 ServiceSecurityContext.PrimaryIdentityServiceSecurityContext.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 返回类型 WindowsIdentityServiceSecurity.PrimaryIdentity 返回类型 IIdentityWindowsIdentity 类型具有比 IIdentity 更多的属性,如果需要,可以帮助您更深入地了解访问权限、声明、 token 和已验证身份用户。

特别是 token 可以帮助您模拟用户,从而获得对特权资源的访问权限。

请参阅https://msdn.microsoft.com/en-us/library/system.security.principal.windowsidentity%28v=vs.110%29.aspx了解详情。

关于wcf - ServiceSecurityContext.WindowsIdentity 的用途?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4370347/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com