|
-
Sep 9th, 2004, 12:02 PM
#1
Thread Starter
Junior Member
Login using NT username and password
Can anyone point me in the right direction on how to create a login page where the user must use their NT username and password. I'm writing a VB.NET program and I can't create my own login tables because the powers that be want only one username and password to remember.
Thanks.
Mike
-
Sep 9th, 2004, 02:11 PM
#2
Addicted Member
You could potentially use the Environment class, specifically the Environment.UserDomainName and the Environment.UserName properties to read the info you're looking for you could assign that to a variable:
Code:
Dim strUserName As String
strUserName = Environment.UserDomainName & "\" & _
Environment.UserName
MessageBox.Show(strUserName)
As a newbie, my thinking may be flawed here, plus I don't know anything else about your app, but I would think that you could compare that name against a dataset that you maintained to determine permisions.
I aslo wonder if someone else might know if there's a way to look up groups membership against the domain. If that were possible, and I would imagine that it is, you could very easily use that technique to establish permissions.
Keep in mind that I have absolutely no knowledge if what techniques are recommended for securing an application, so me idea, while it would work may not be considered to be a preferred or even an accepted method.
By the way, this technique would eliminate the need for a login dialog, since who the user is is already established.
I hope my $.02 helped.
Steve
-
Sep 9th, 2004, 02:21 PM
#3
Addicted Member
What exactly do you want to use the username and password for?
You can use System.Security.Principal.WindowsIdentity.Name to get their logon name, and/or System.Security.Principal.WindowsIdentity.IsAuthenticated to determine if they are authenticated. I don't know of any way to get their password though (for obvious security reasons, there may not be a way).
-
Sep 10th, 2004, 09:24 AM
#4
Thread Starter
Junior Member
I'm not so much looking for a password, what I really need to do is validate them before they enter my program. I certainly am not looking for their password, I just need to be able to have different people logon to the app from potentially the same machine.
A co-worker of mine has an idea so I'll get back to you with an answer (hopefully) and post it here for anyone interested.
Thanks again for the replies.
Mike
-
Sep 10th, 2004, 09:30 AM
#5
Lively Member
Mike -
I'm certainly interested! I've been thinking about this subject lately as I've got a potential use for using 'Windows Authentication' to allow users into an application and/or areas of a web...
I'll be looking for your post.
-
Sep 10th, 2004, 09:35 AM
#6
Addicted Member
There are easy methods in ASP.NET to authenticate users to a local machine or a windows domain, and I'm guessing there similar easy methods to do the same in other parts of the .NET framework, but I'm not familiar with them.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|