开发者

How to show the user the default windows authentication prompt from a windows form using c#?

开发者 https://www.devze.com 2023-04-12 09:11 出处:网络
I thought this would be a very common practice, but I am having a hard time finding anything on how to show the user a default windows authentication credential prompt in c#?

I thought this would be a very common practice, but I am having a hard time finding anything on how to show the user a default windows authentication credential prompt in c#?

Users will be using this windows forms app to connect to a web service on a different domain, so I cant just pass in the default credentials. These users will have a separa开发者_如何学Cte login to access the web service, and I want them to be prompted by the default Windows prompt, and then I can pass their creds through to the web service.

Thanks!


This was answered on SO a while back, I believe. You can use the credential management API. Here's a link with a code example that should get you started.


You need to P/invoke CredUIPromptForWindowsCredentials on Vista and up, or CredUIPromptForCredentials on XP.

0

精彩评论

暂无评论...
验证码 换一张
取 消