Our team uses a website that uses NT Authentication. I need to point my automation scripts to that site. This n开发者_运维技巧eeds passing the credentials of the testuser accounts to the application and not mine.
How do I do that programmatically so that the application won't prompt for the credentials.
Alternatively, can somebody suggest a way to handle the windows security prompt so that I can enter the username and password there and then?
thx
You will want to impersonate in your calling C# app, then connect to the site with integrated windows auth.
Here is a tutorial on how to impersonate from a C# app to make a remote call: http://www.codeproject.com/KB/cs/cpimpersonation1.aspx
What you need is called HttpWebRequest. Look at this answer, previously posted on SO: Login to the page with HttpWebRequest
精彩评论