简体   繁体   English

如何在数据库中存储Windows身份验证信息

[英]How store windows auth information in database

I have an application in an intranet scenario: windows form, using wcf transport security and windows authentication ( using this pattern ). 我在Intranet场景中有一个应用程序:Windows窗体,使用wcf传输安全性和Windows身份验证( 使用此模式 )。 And I need to store windows users information and connect the windows user in my table "Person" (using Sql Server). 而且我需要存储Windows用户信息并在我的表“ Person”中连接Windows用户(使用Sql Server)。 But I have no idea what the best way to do this. 但是我不知道什么是最好的方法。 Anyone can help me in a way to solve? 有人可以帮助我解决问题吗?

The best bet is to store the user's SID, this will never change for a given user, whereas the login name can be changed. 最好的选择是存储用户的SID,这对于给定的用户永远不会更改,而登录名可以更改。 If you can get to the WindowsIdentity for the user, the SID is in the User property. 如果可以找到该用户的WindowsIdentity,则SID在User属性中。

您可能有一个表,其中存储Windows用户名和关联的“个人”条目。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM