Weird forms authentication, Please help!!!

From: chris han (chris_han@baxter.com)
Date: 02/11/03


From: "chris han" <chris_han@baxter.com>
Date: Tue, 11 Feb 2003 12:06:19 -0500

Hi, all,

I get this problem only on some specific combination of server and client:
I have a logon page:
//////////////////////////////////////////////////////
FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(1,CurrentUser.UserId, System.DateTime.Now,System.DateTime.Now.AddDays (1), false,"Admin");
HttpCookie AuthCookie = new HttpCookie (FormsAuthentication.FormsCookieName);

AuthCookie.Value= FormsAuthentication.Encrypt (ticket);

Response.Cookies.Add (AuthCookie);

FormsAuthentication.RedirectFromLoginPage(CurrentUser.UserId, false);

//////////////////////////////////////////////////////
I was kept sending back to this logon page.

I also tried this:
//////////////////////////////////////////////////////
FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(1,CurrentUser.UserId, System.DateTime.Now,System.DateTime.Now.AddDays (1), false,"Admin");
HttpCookie AuthCookie = new HttpCookie (FormsAuthentication.FormsCookieName);

AuthCookie.Value= FormsAuthentication.Encrypt (ticket);

Response.Cookies.Add (AuthCookie);

Response.Redirect ("SecondPage.aspx");

//////////////////////////////////////////////////////
It showed "Object is moved." and coming with a link to "SecondPage.aspx", when I clicked on that, I was sent back to longon page again.
I then try this:
//////////////////////////////////////////////////////
FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(1,CurrentUser.UserId, System.DateTime.Now,System.DateTime.Now.AddDays (1), false,"Admin");
HttpCookie AuthCookie = new HttpCookie (FormsAuthentication.FormsCookieName);

AuthCookie.Value= FormsAuthentication.Encrypt (ticket);

Response.Cookies.Add (AuthCookie);

Server.Transfer ("SecondPage.aspx");

//////////////////////////////////////////////////////
I past the "SecondPage.aspx"! but been sent back again when I went further.

It does not seem like a cookie issue cause I put a line of code after, like this:
strAuth=Request.Cookies[FormsAuthentication.FormsCookieName].Value ;

and I got the value.

Thank for any clue?

Chris Han



Relevant Pages

  • Help needed regarding Office Sharepoint Integration.
    ... I have no luck with Sharepoint Office Integration since WSS ... Service Ticket Granted: ... Client Address: 192.168.0.10 ... Successful Logon: ...
    (microsoft.public.sharepoint.windowsservices)
  • RE: Missing IP address in Security Audit
    ... Authentication Ticket Granted: ... Client Address: 127.0.0.1 ... > audit for successful logon as well. ... > event log(Security(but it does not capture the correct IP of the remote host ...
    (microsoft.public.win2000.security)
  • Re: Missing IP address in Security Audit
    ... Be sure you check all the logon event entries. ... Service Ticket Request: ... Client Address: 192.168.1.52 ... > Ticket Encryption Type: 0x17 ...
    (microsoft.public.win2000.security)