Scenario - When I go to URL 1 in my browser, it authenticates me based on the querystrings and redirects me to a page where I can see the information I want. I can see that upon going to URL 1 and being authenticated there about 6-7 cookies that get added to my browser. Once I have been redirected, I open a different URL - URL 2 and it opens without an issue.
If I try to do the same using HttpWebRequest or WebBrowser in C#, I never receive the cookies from the first request - I have a feeling this is because I am not waiting for the response to end before moving on to making a request to URL 2.
I think what I need to do is
- Make a request to URL 1
- Wait for the response and redirect
- Now I SHOULD have access to cookies to put in a cookie container to go off to page 2
- page 2 should open up to give me the info I need instead of returning 401