|
-
Mar 3rd, 2006, 03:05 PM
#1
Thread Starter
New Member
Login using Windows Authentication
Anyone have any great ideas on how to incorporate a login from using the network or Windows login information to authenticate against? ie if my login info was username: p and passsword: q, I want to be able to enter that same information into the login screen of my vb6 program and have it authenticated the same way the network/windows login is authenticated. I know I can get the user and the computer but that really ins't what I need, I also know about checking a table or file, but again, not what I am looking for. Any suggestions, code showing how to implement is appreciated.
-
Mar 4th, 2006, 08:10 PM
#2
Re: Login using Windows Authentication
Welcome to th fourms 
I do think if you look at the VB Applicaiton Wizard, it will allow you to incorparate a login screen, which im sure uses the users username and password, for the device they are working on, take a look at that, and if needed, steal the code 
ILMV
-
Mar 4th, 2006, 08:40 PM
#3
Re: Login using Windows Authentication
You would have to use some APIs if your not running Active Directory to at least verify the user and possibly authenticate but I'm not 100% sure you can as most of the security resources of Windows are C++ dlls and arent able to be used in VB.
The other option is if you are running AD then you can verify a user and pwd.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Mar 5th, 2006, 06:48 AM
#4
Frenzied Member
Re: Login using Windows Authentication
If someone is allready signed in, why you ask he sign again?
If Windows / AD passwords are picked up from somewhere, they are not any security matters.
oh1mie/Vic

-
Mar 6th, 2006, 09:29 AM
#5
Thread Starter
New Member
Re: Login using Windows Authentication
Hello, thank you all for your replies. I actually found a away to do it. Basically, authenticates that they are a user by seeing if they exist in the domain. I still am going to have to control feature access per user id, that is what I thought was only needed in the first place but others thought they needed to authenticate...I guess in case someone else tries to run the app...??? But even then, I will do my own authenticating based soley on the user id so...wait stop. I am having this same discussion here that I have already had with others...anyway, here is the code that I used...:
Dim oIADS
sNTDomain = ""
sUsername =frmLogin.txtewid.Text
spassword =frmLogin.txtewpwd.Text
Set oIADS = GetObject("WinNT:").OpenDSObject("WinNT://" & _
sNTDomain, _
sUsername, _
spassword, _
ADS_SECURE_AUTHENTICATION)
Set oIADS = Nothing
Then if it fails, it will go to error handler, and you know that one of the items you passed is incorrect. If it goes through, then you know the user has is truly the user who entered the ID and that is trying to access the application.
-
Mar 6th, 2006, 10:03 AM
#6
Frenzied Member
Re: Login using Windows Authentication
The program must be very known, before giving AD password for it.
Ho says than is not phishing going on.
oh1mie/Vic

-
Mar 6th, 2006, 10:43 AM
#7
Thread Starter
New Member
Re: Login using Windows Authentication
Say again? I am not sure I understand what you are meaning....
-
Mar 6th, 2006, 10:58 AM
#8
Frenzied Member
Re: Login using Windows Authentication
I dont think than is good idea ask typing AD passwords if program is not fully trusted and known.
By my self, I'm allways distrustful
oh1mie/Vic

-
Mar 6th, 2006, 11:17 AM
#9
Thread Starter
New Member
Re: Login using Windows Authentication
OK, I understand now, yes, I see what you are saying. This is a fully trusted program, it is an internal developed application and really, only people who normally work with it have access to it. So...I think it will be OK. However like you I tend to be distrustful also.
-
Mar 6th, 2006, 12:17 PM
#10
Re: Login using Windows Authentication
Asking for a Windows USERNAME/PASSWORD is not a good idea in my opinion.
Workstation security should be handled through things like "time-outs" to screen savers that require the person unlock the PC to continue.
Once a person is logged on to the system you should not be asking for username or password again - that's not a standard technique and I also consider it to be a very bad idea.
-
Mar 6th, 2006, 12:25 PM
#11
Thread Starter
New Member
Re: Login using Windows Authentication
I agree, I don't really like asking for it again, hence the original question might should have said, I understand how to get the logged on users username, how do I get password to pass to other applications that are opened and in turn will use the same credentials to say...log on to another server and do an ftp or something.
-
Mar 6th, 2006, 12:55 PM
#12
Re: Login using Windows Authentication
 Originally Posted by actionjack2006
I agree, I don't really like asking for it again, hence the original question might should have said, I understand how to get the logged on users username, how do I get password to pass to other applications that are opened and in turn will use the same credentials to say...log on to another server and do an ftp or something.
If you are all in the domain why do you need a un/pw to talk to an ftp box? Wouldn't the proper method be to make shares and allow access through the domain controls?
If they are using WINDOWS XP PROFESSIONAL then look at the link in my signature about non-domain authentication. It works for domain authenticaton as well...
Basically under MANAGE PASSWORDS you can load additional server's with un/pw credentials for login without a "pop-up" login window.
-
Dec 14th, 2007, 01:10 AM
#13
New Member
Re: Login using Windows Authentication
thansk man action jack..........for the code infact i was also searching for the same..and one more thing...i feel that everyone else who replied for ur question wa just beating around the bush....(may be they dotn know actually what to do.....)...plz friends...if u know a way around a problem plz do make it clear for the one who ptus the question......atleast plz dont confuse even if the question is not answered....!!!!!
cheeersssssss
-
Dec 14th, 2007, 07:00 AM
#14
Re: Login using Windows Authentication
 Originally Posted by madhavanjayaram
thansk man action jack..........for the code infact i was also searching for the same..and one more thing...i feel that everyone else who replied for ur question wa just beating around the bush....(may be they dotn know actually what to do.....)...plz friends...if u know a way around a problem plz do make it clear for the one who ptus the question......atleast plz dont confuse even if the question is not answered....!!!!!
cheeersssssss 
Actually there is code in the CODE BANK on the forum here to authenticate to the ACTIVE DOMAIN.
But as was said in most of the posts in this thread asking for a un/pw after a machine is logged on is not a good idea.
Windows allows for credentials to be stored - the link is in my signature - so that re-asking for a domain password is not needed during run time.
Windows also passes existing logon credentials along to many network type calls.
Did you find your solution in this thread? I could barely understand what your post meant.
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
|