Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Windows Authentication

Status
Not open for further replies.

FancyPrairie

Programmer
Oct 16, 2001
2,917
US
We have many users that share a pc and, consequently, use the same login (not good, but that's the way it is). However, I need to know who is using the program. For valid reasons, Access Security is not an option in this case. Consequently, I would like to pop up the Windows login dialog box to authenticate the user's credentials. I've seen examples in C++ (via google search), but have had no luck duplicating it in vba. It appears that the dll that is used is credui.dll.

Has anyone done this before?
 
Right. I'm trying to get to Environ("username"). However, since several users share the same pc and login (I guess I failed to mention that), environ("username") would not let me know which one of the user's is using the system. That's why I need to use Windows Authentication. I could then simply popup the Windows login window, have the user enter their nt name and password and windows would tell me whether it's valid or not. It's doable. Just don't know how to do it in vbscript or vba.
 
When invoking the Windows login screen the current user would in fact be logged of and the new user be logged in. Since all users use the same login - what would be changed then!? On the other side if it were possible for every application to present the user a "windows login screen" and catch his userid and password this would open the gates wide for misuse.
So you would have toi create your own dialog to ask for the users name and store this information in some place.
But even then you can´t be sure that Jimmy the clerk types in the name of the boss and makes your program believe that the boss is using it.
The only reasonable solution would be to delete the current shared account and to create a new one for each user and have them login as themselves and not somebody else...
 
Environ("UserName") is windows authentication. If they share a single login it will be impossible to differentiate between users, because to the computer all users are the same user. :)

James Goodman MCSE, MCDBA
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top