Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Security > FormsAuthentication problem with popup login window

Reply
Thread Tools

FormsAuthentication problem with popup login window

 
 
Mark Farragher
Guest
Posts: n/a
 
      09-25-2003
I have a problem with FormsAuthentication:

I have two web applications:
http://localhost/bx/authentication
http://localhost/myapp

I have a 'login' hyperlink in MyApp that opens
http://localhost/bx/authentication/login.aspx in a popup window. The popup
window has a username and password text field and an ok button. The
postback
code for the ok button is:

....
FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(
1, txtUID.Text, DateTime.Now, DateTime.Now.AddMinutes(30), false,
myPayload);
string ticketstring = FormsAuthentication.Encrypt(ticket);
HttpCookie cookie = new HttpCookie(FormsAuthentication.FormsCookieName,
ticketstring);
Response.Cookies.Add(cookie);
....

The web.config file in both applications has an authentication section:

....
<authentication mode="Forms">
<forms name="BXAuthentication" protection="All" />
</authentication>
....

This does not work. User.Identity is always null in MyApp. The weird thing
is that when I add this code to MyApp's Page_Load method:

Response.Write
(Request.Cookies[FormsAuthentication.FormsCookieName].Value.ToString());

I can actually see the serialized login ticket!! So the cookie is passed
correctly from the popup window to MyApp, but somehow this does not count
as
being authenticated. How can I get MyApp to 'accept' the cookie? What am I
missing? Is authentication accross AppDomains possible at all?

Thanks for any help,

Mark



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Popup Window Popup Timing =?Utf-8?B?Sm9obiBXYWxrZXI=?= ASP .Net 3 11-04-2005 07:33 PM
Redirecting to login page from a popup window. =?Utf-8?B?S2FseWFuaQ==?= ASP .Net 1 06-21-2005 09:21 AM
New Popup Window from an existing Popup Window Raffi Javascript 4 08-12-2004 01:21 PM
Main > Popup > Popup > Close popup AND new URL in main? Jens Peter Hansen Javascript 7 06-19-2004 08:56 PM
FormsAuthentication problem with popup login window Mark Farragher ASP .Net Security 1 09-28-2003 11:52 PM



Advertisments