2010-12-06 31 views
3

ServiceSecurityContext包含WindowsIdentity屬性?ServiceSecurityContext.WindowsIdentity的用途?

即,如果用戶正在使用的窗口認證機制認證,則既ServiceSecurityContext.PrimaryIdentityServiceSecurityContext.WindowsIdentity屬性保持完全相同的信息,並且如果用戶使用一些其它認證機制認證,則ServiceSecurityContext。 WindowsIdentity將保留空白標識。

因此,在第一種情況下的WindowsIdentity屬性保存的數據相同的數據PrimaryIdentity,而在第二種情況下,它保持在所有無數據(即,它保持空白同一性)。

謝謝

回答

0

也就是說,如果用戶使用Windows身份驗證機制 驗證,那麼這兩個ServiceSecurityContext.PrimaryIdentity和 ServiceSecurityContext.WindowsIdentity性能保持完全 相同的信息

只是簡單的錯誤。

ServiceSecurityContext.WindowsIdentity返回類型WindowsIdentityServiceSecurity.PrimaryIdentity返回類型IIdentityWindowsIdentity類型具有比IIdentity更多的屬性,可幫助您在需要時更深入地瞭解已認證用戶的訪問權限,聲明,標記和身份。

令牌尤其可以幫助您模擬用戶,從而獲得對特權資源的訪問權限。

詳情請參閱https://msdn.microsoft.com/en-us/library/system.security.principal.windowsidentity%28v=vs.110%29.aspx