Authentication of a user

  • Thread starter Thread starter Peter Tragardh
  • Start date Start date
P

Peter Tragardh

I'm searching for info on how to authenticate a user in the same way that
for example Source Safe does. I would like my system to use Windows as the
authenticator, so that the user doesn't have to log on separately to access
my system.
 
Hello Peter,

Not sure why do you've given SourceSafe as the example... SourceSafe
databases maintain its own lists of users.
Anyway, I think you should take a look at the WindowsIdentity and
WindowsPrincipal classes:

using System.Security.Principal;

WindowsIdentity curUser = WindowsIdentity.GetCurrent();
bool allow = curUser.IsAuthenticated;

WindowsPrincipal membership = new WindowsPrincipal(curUser);
bool isAdmin = membership.IsInRole("BUILTIN\\Administrators");
 
I gave MSS as an example of the workflow, not an example of the technical
aspects. During my research I've learned that the term for the function
I'm looking for is single sign-on, and that is how I see MSS. I never log
on specifically to MSS, I only log on Windows, and if the users are
correctly defined in MSS, I just "get in".

I can also imagine that my system has to have it's own user registry to
cope with it's internal permissions, what functions a user may or may not
use. If not, I'm curious of how such a solution might work.
 
I gave MSS as an example of the workflow, not an example of the technical
aspects. During my research I've learned that the term for the function
I'm looking for is single sign-on, and that is how I see MSS. I never log
on specifically to MSS, I only log on Windows, and if the users are
correctly defined in MSS, I just "get in".

It's probably because the names of the VSS users match the Windows
logon names. AFAIK your logon name is the first thing the VSS client
attempts to log in to a VSS database, so if the two match, you
"just get in".
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top