Hi, My question is about programmatic use of Windows authentication. Is there a way to prompt the user for his/her password (and optionally a user name) and return a simple authentication pass/fail result (plus user name if applicable) to the caller? To elaborate: I'm developing a Windows application that needs to do two things: (a) confirm the identity of the current user at various stages to provide a chain of custody; (b) confirm the identity of a user other than the current one, for example when a supervisor wishes to access restricted functionality. Clearly, I could do this by implementing my own password system but I'd like to use Windows authentication if possible as this would be both more elegant and more secure. The application is a client-server system written in VB under VS 2005 using SQL Server 2005 as the back end. All machines/accounts are part of the same domain and all users of the system have Windows domain accounts. Any suggestions would be appreciated. Thank you in anticipation.
I've now found article 841699 which provides the information I need, including an example. I'm therefore posting this reply as a signpost for anyone looking for the same solution. If anyone out there knows of a way to accomplish the same thing without having to handle user passwords at all (ie, letting the OS display its own dialog) I'd still be interested in hearing from them.
On Apr 28, 7:11 am, Gholson wrote: > Hi, > > My question is about programmatic use of Windows authentication. Is there a > way to prompt the user for his/her password (and optionally a user name) and > return a simple authentication pass/fail result (plus user name if > applicable) to the caller? > > To elaborate: I'm developing a Windows application that needs to do two > things: (a) confirm the identity of the current user at various stages to > provide a chain of custody; (b) confirm the identity of a user other than the > current one, for example when a supervisor wishes to access restricted > functionality. > > Clearly, I could do this by implementing my own password system but I'd like > to use Windows authentication if possible as this would be both more elegant > and more secure. The application is a client-server system written in VB > under VS 2005 using SQL Server 2005 as the back end. All machines/accounts> are part of the same domain and all users of the system have Windows domain > accounts. > > Any suggestions would be appreciated. Thank you in anticipation. Hi, You can use the following APIs to create and display a configurable dialog box that accepts credentials information from a user: CredUIPromptForCredentials() CredUIPromptForWindowsCredentials() http://msdn2.microsoft.com/en-us/library/aa375177(VS.85).aspx http://msdn2.microsoft.com/en-us/library/aa375178(VS.85).aspx Kellie.