Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Login dialog for Windows client application

Is there a Win32 function I can call to show a Windows login dialog?

E.g., Internet Explorer and Visual Studio's Team Explorer both show a credentials dialog when accessing a website - how can I show that dialog?

I have a .NET Windows client application that uses the logged in Windows user identity when communicating to web services. The services use that user ID to determine who is calling the service and to decide what they have permissions to see.

I would like to add a command that allows the current user to do effectively a "run as", where they can enter the username/password of another user and we have the application act as them.

I could build a custom dialog and use the LoginUser() function, but I would rather use something "official".

like image 484
Paul Stovell Avatar asked Jun 19 '09 15:06

Paul Stovell


1 Answers

You can use the CredUIPromptForCredentials API function

See also here

like image 178
SLaks Avatar answered Nov 09 '22 23:11

SLaks