By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,958 Members | 1,179 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,958 IT Pros & Developers. It's quick & easy.

Authentication of a user

P: n/a
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.
Nov 16 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
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");
--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://www.x-unity.net/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

"Peter Tragardh" <pe************@hotmail.com> wrote in message
news:Xn*********************************@207.46.24 8.16...
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.


Nov 16 '05 #2

P: n/a
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.
"Dmitriy Lapshin [C# / .NET MVP]" <x-****@no-spam-please.hotpop.com>
wrote in news:#k**************@TK2MSFTNGP12.phx.gbl:
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");


Nov 16 '05 #3

P: n/a
> 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".

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://www.x-unity.net/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

"Peter Tragardh" <pe************@hotmail.com> wrote in message
news:Xn**********************************@207.46.2 48.16... 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.
"Dmitriy Lapshin [C# / .NET MVP]" <x-****@no-spam-please.hotpop.com>
wrote in news:#k**************@TK2MSFTNGP12.phx.gbl:
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");


Nov 16 '05 #4

P: n/a
Anyway, the examples you gave was what I was looking for.
Nov 16 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.