I am trying to programatically gain access to a Sharepoint site behind a UAG gateway.
I am doing this with Python, using urllib2 and a cookie container.
The situation is very similar to the one posted here: http://social.technet.microsoft.com/Forums/forefront/en-US/9c499638-73b3-4a37-bf70-7f807bec05ee/uag-authentication-from-code
The sequence I go through is:
- Request Sharepoint URL
- Redirected to a uniquesigxxxx/InitParams.aspx page
- Redirected to a uniquesigxxx/Login.asp page
- Emulate javascript in response (POST credentials to uniquesigxxx/Validate.asp page)
- Emulate javascript in response (GET uniquesigxxx/RedirectToOrigURL.asp?zzzz page)
- Redirected to the original url
- Redirected to the original url again
In the browser, step 7 is when the originally requested url is delivered and various Sharepoint session cookies are returned.
The 3 session cookies I am getting and passing back from the original response are:
- ASPSESSIONIDxxx=yyy
- uniquesigxxxxx=yyy
- NLSessionSportal=xxxx
I also make a request to /InternalSite/?WhlST before validate.asp which sets a WhlST cookie.
The only difference between the browser login process and the script login process that I can glean is that the browser sends back different values for the ASPSESSIONIDxxx and uniquesigxxx cookies in the response to step 6 above. I don't get that with the script for some reason.
Is anyone able to help? I have used Fiddler extensively to try and debug this but I am well and truely stuck.