Problem carrying authentication forward to other pages after login

From: David Hirschfeld (dhirschfeld@cox.net)
Date: 02/18/03


From: "David Hirschfeld" <dhirschfeld@cox.net>
Date: Tue, 18 Feb 2003 08:26:01 -0800


Using VB.Net
I have developed a screenscraping application to catalog
data from certain website. This works great except that
now I have to get data from a site that requires me to
first login via a login web page. I have no problem
logging in to the page, but I can't figure out how to
capture the authentication and pass it on to subsequent
pages.
I am having a problem carrying forward the authentication
to subsequent pages.

I tried NetworkCredentials but that didn't work.

HTTPWebResponse.Cookies.Count = 0 however, the
HTTPWebResponse.Headers.Item.GetValue("set-cookies")
displays the following: (UID and PW are ficticious)

CFID=31563; expires=Sun, 27-Sep-2037 00:00:00 GMT;
path=/;,CFTOKEN=91427790; expires=Sun, 27-Sep-2037
00:00:00 GMT; path=/;,CID=44352; path=/;
domain=.domain.com;,LOGIN=gina; path=/;
domain=.domain.com;,MASK_CID=44352; path=/;
domain=.domain.com;,MASK_LOGIN=gina; path=/;
domain=.domain.com;,MASK_PASSWORD=%CD%B%D3%C1%D0%DC;
path=/; domain=.domain.com;,MASK_STATUS=350; path=/;
domain=.domain.com;,MASK_UID=44417; path=/;
domain=.domain.com;,MASK_USERNAME=gina+hansen; path=/;
domain=.domain.com;,PASSWORD=%C1%D3%D3%CD%D8%CD; path=/;
domain=.domain.com;,PID=113094; expires=Sun, 27-Sep-2037
00:00:00 GMT; path=/; domain=.domain.com;,PRIV_MAINT=0;
path=/; domain=.domain.com;,STATUS=350; path=/;
domain=.domain.com;,UID=44417; expires=Tue, 18-Mar-2003
12:33:36 GMT; path=/;
domain=.domain.com;,USERNAME=gina+Ganzman; path=/;
domain=.domain.com;,ZORO=0; path=/; domain=.domain.com;

I don't know how to convert this data into a cookie and
add it to the HTTPWebrequest.CookieContainer. When I try
to directly add this data into HTTPWebrequest.headers.Add
("set-cookie", <the above data>...) nothing happens.

Can someone please tell me what I'm doing wrong?



Relevant Pages

  • Re: Best way to check for first Login
    ... when I add this handler I stop the authentication taking place. ... is there another way to check for first login? ... DateTime CreatedDateTime = Membership.GetUser.CreationDate; ... DateTime LastLoggedInDateTime = ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Sharepoint publishing, web listenter question
    ... allowing the root page to be accessed by ... > rest requiring Windows Integrated? ... > authentication) required and the other rule publishes the remaining site, ... >>> available to the public and from there I let the subsequent pages ...
    (microsoft.public.isa)
  • Re: SSH Password Authentication
    ... > The authentication method is with a password. ... After the first login, I ... > never was asked again for the password on the UNIX Backup Server. ...
    (comp.security.ssh)
  • Re: iis 6 ssl redirect initial login encrypted?
    ... Are you wanting everything (all subsequent page views) to be run over SSL too, or just the authentication? ... Grant. ...
    (microsoft.public.inetserver.iis.security)