1
I need to implement an authentication system written in C#. NET based on users of Windows, so it will be authenticated according to some identification only of users.
The problem is that the only viable identification I have found that can represent a user is SID, but I have some small doubts about it:
- A user’s SID logged in to the Microsoft Live account will be the same as SID if it is logged in to other machines?
- A SID is generated randomly for a local user?
- If the first question is no, and SID is just one local user identifier for machine, how can I get an identification whose is unique to a Microsoft Live account, and random to a local account?
This is the code used to get the user’s SID which is "logged in" to the machine:
WindowsIdentity user = WindowsIdentity.GetCurrent();
SecurityIdentifier sid = user.User;