I want to login to a Sharepoint portal which brings up a login dialog but is using NTLM authentication. How can I modify the HTTP headers in C# to make a successful login request? I assume I would need to make a HTTPWebRequest to a page within the logged in section of the portal and post the HTTP headers collection alongside this?
![]() ![]() ![]() 1
|
|||
|
![]() ![]() |
You can do this using the WebRequest class.
This code reads the whole response into a variable called |
||
|
![]() ![]() |
To use NTLM see John's answer. If you need to have headers across sessions look at the CookieContainer property on the HttpWebRequest object. You will need to keep a reference to your CookieContainer and attach it to any other HttpWebRequests you make. |
||
|