I need to implement an authentication system written in C # .NET based on Windows users, so it will be authenticated according to some unique user identification p>
The problem is that the only workable ID I've encountered that might represent a user is SID, but I have a few minor questions about it:
- Will a SID of a user logged into the Microsoft Live account be the same SID if it is connected to other machines?
- Is a SID generated randomly for a local user?
- If the first question is no, and the SID is just a local user identifier for the machine , how can I get an ID whose is unique to a Microsoft Live account, and to a local account?
This is the code used to get the SID of the user that is logged in to the machine :
WindowsIdentity user = WindowsIdentity.GetCurrent();
SecurityIdentifier sid = user.User;