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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Retrieving the WinNT Login Information

Status
Not open for further replies.

Guest_imported

New member
Joined
Jan 1, 1970
Messages
0
Does anyone know of an API call to use to get the username and Password from the current Windows user?

I have used the GetUserName API which returns the NT Username, but have not got anything to return the password.

The reason I need it, and maybe someone has a better way, is that our company uses Windows NT Authentication to connect to our SQL Server. I want to maintain this without using a DSN, therefore, pass in the Windows username and login to the SQL Server to allow connection to the database. I want to use the authentication info to restrict the view of the database objects that are going to be displayed to only the objects that the current user has access to.
 
doogie000007,

I hate to break this to you, but there is no API to get user passwords off of WINNT. The OS' response/challenge method does not need to make passwords publically available. This is part of NT's security model.
If you are working with SQL server, and you want to restrict parts of you app based upon users, why not move your app into MTS and implement procedure level security using the UserInRole and MTS Roles? This is a more conventional approach. - Jeff Marler B-)
 
This FAQ ( faq222-429 ) shows you how to get the user login ID. But, as jmarler noted, you can't get the password.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top